New style classes and rich comparison
Michael Hudson
mwh at python.net
Thu Dec 18 09:35:15 EST 2003
More information about the Python-list mailing list
Thu Dec 18 09:35:15 EST 2003
- Previous message (by thread): Searching docs (was Re: Logging)
- Next message (by thread): New style classes and rich comparison
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
stain at stud.ntnu.no (Stian Søiland) writes: > Could anyone explain to me why this does not work as intended? [snippo] > It seems that __eq__ is fetched directly from newbie's class, not from > newbie. Yup! One of the differences between new-style and old-style classes. To see why something has to be a bit like this, consider the difference between a unbound method for the instance and a bound method for the *type* of the instance... [biggo snippo] > Can I use __metaclass__ or something? I think that's what you want, yes. Cheers, mwh -- Ignoring the rules in the FAQ: 1" slice in spleen and prevention of immediate medical care. -- Mark C. Langston, asr
- Previous message (by thread): Searching docs (was Re: Logging)
- Next message (by thread): New style classes and rich comparison
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list