[Python-Dev] PEP: Adding data-type objects to Python

Ronald Oussoren ronaldoussoren at mac.com
Thu Nov 2 22:38:08 CET 2006


On Nov 2, 2006, at 9:35 PM, Thomas Heller wrote:

> Ronald Oussoren schrieb:
>> On Oct 31, 2006, at 6:38 PM, Thomas Heller wrote:
>>
>>>
>>> This mechanism is probably a hack because it'n not possible to add
>>> C accessible
>>> fields to type objects, on the other hand it is extensible (in
>>> principle, at least).
>>
>> I better start rewriting PyObjC then :-). PyObjC stores some addition
>> information in the type objects that are used to describe Objective-C
>> classes (such as a reference to the proxied class).
>>
>> IIRC This has been possible from Python 2.3.
>
> I assume you are referring to the code in pyobjc/Modules/objc/objc- 
> class.h

Yes.

>
> If this really is reliable I should better start rewriting ctypes  
> then ;-).
>
> Hm, I always thought there was some additional magic going on with  
> type
> objects, fields appended dynamically at the end or whatever.

There is such magic, but that magic was updated in Python 2.3 to  
allow type-object extensions like this.

Ronald
-------------- 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-dev/attachments/20061102/fc916cd2/attachment.bin 


More information about the Python-Dev mailing list