Kevin Jacobs <jacobs@penguin.theopalgroup.com> writes: > On Thu, 6 Feb 2003, Guido van Rossum wrote: > > Hm... Given this feedback, it sounds like the only way to implement > > Christian's suggestion in a backwards-compatible way would be to use a > > different __xxx__ name, e.g. __fields__. I also like the suggestion > > of allowing control over the order as well. > > Not to be difficult, but I already use '__fields__' for the same purpose as > dictionaries assigned to __slots__ for non-slot attributes. > > (Yes, I know that this means nothing, since __xyz__ names are fair game, > though I think it is extremely funny that fate is trying to kill my > ConatraintObject metatype) That's the exact reason ctypes uses '_fields_' as the name ;-) Although I'm currently wondering if I should use __slots__ instead, and set it to a whatever is needed. Each tp_new could retrieve whatever info it needs from it, and pass the mangled resulting __slots__ to the base metaclass tp_new thing. Thomas
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4