Thread Previous • Date Previous • Date Next • Thread Next |
In addition, __foo__ is syntax for protected members, not for the users interface. No?
I think the idea is that __ names are for attributes that are "metadata" for the objects.
What about this: http://codesinger.blogspot.com/2009/02/dont-use-in-python-unless-you-are.html Well, do you need often to test type name? You can say
s.__class__==Sphere (it should be also faster), since Sphere is a real python class now. Is that better?
Ok, no problem. But s.shape.name==Sphere (or just s.shape==Sphere) is better in any case :))
-- Best regards, Sergei D.
Thread Previous • Date Previous • Date Next • Thread Next |