[Python-3000] Metaclasses in Py3K
ronaldoussoren at mac.com
Mon Dec 18 08:17:51 CET 2006
On 16 Dec, 2006, at 22:39, Steven Bethard wrote:
>> The main issue for me is that I think that its important to
>> between get/set operations that are done at class definition time,
>> get/set operations that are done later, after the class is created.
> Why? Can you explain your use case? Everything I'd care to do would
> treat later get/set operations on the class in the same way.
I don't know about Phillip, but my usecase for this would be setting
up C datastructures that cannot be updated later on. That is, at the
end of the class definition a metaclass (possibly written in C) sets
up a datastructure in C from information found in the class dict with
a library that doesn't allow updates of said datastructure afterwards.
My main usage for that is PyObjC: we have objc.ivar() properties that
create an instance variable in the corresponding Objective-C class.
Those can be added during class construction but not afterwards
(because that would break existing instances).
> I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
> tiny blip on the distant coast of sanity.
> --- Bucky Katt, Get Fuzzy
> Python-3000 mailing list
> Python-3000 at python.org
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3562 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-3000/attachments/20061218/4bb79df6/attachment-0001.bin
More information about the Python-3000