[Python-3000] pep3115 - metaclasses in python 3000 (original) (raw)
Guido van Rossum guido at python.org
Tue Jul 17 02:11:09 CEST 2007
- Previous message: [Python-3000] pep3115 - metaclasses in python 3000
- Next message: [Python-3000] TextIOWrapper.write(s:str) and bytes in py3k-struni
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 7/16/07, Guido van Rossum <guido at python.org> wrote:
The object returned by prepare() actually is incorporated into the class object, unless the metaclass' new() passes something else to type.new(). However this isn't obvious when you ask for the class' dict attribute: you always get a dict proxy.
I take it back. The object is copied, for the reasons Phillip explained. There is no way around this without writing C code, as the only way to create a type object from Python is to call type.new() -- the new() method if a subclass of type still must call type's new() method to create the actual object.
(Embarrassed, since I wrote all the code involved.)
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-3000] pep3115 - metaclasses in python 3000
- Next message: [Python-3000] TextIOWrapper.write(s:str) and bytes in py3k-struni
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]