[Python-3000] Metaclasses in Py3K (original) (raw)
Ronald Oussoren ronaldoussoren at mac.com
Mon Dec 18 08:17:51 CET 2006
- Previous message: [Python-3000] Metaclasses in Py3K
- Next message: [Python-3000] Metaclasses in Py3K
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 16 Dec, 2006, at 22:39, Steven Bethard wrote:
The main issue for me is that I think that its important to distinguish between get/set operations that are done at class definition time, and 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).
Ronald
STeVe -- 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 http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/ ronaldoussoren%40mac.com
-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3562 bytes Desc: not available Url : http://mail.python.org/pipermail/python-3000/attachments/20061218/4bb79df6/attachment-0001.bin
- Previous message: [Python-3000] Metaclasses in Py3K
- Next message: [Python-3000] Metaclasses in Py3K
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]