Re: [Pyobjc-dev] Re: Making List<->Array bridging transparent
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2002-11-09 14:11:31
|
On Saturday, Nov 9, 2002, at 11:31 Europe/Amsterdam, Peter Montagner wrote: > Bill Bumgarner wrote: > >> ... is true, then we add <type 'list'> to the bases for the newly >> created Python class object? Assuming a complete implementation of >> convenience methods, this would allow bridged instances of NSArray to >> function fully on the Python side of the bridge [i.e. work in contexts >> like the above where the runtime is testing for a particular type and >> not just a set of methods]. >> >> As an experiment, I tried-- naively-- to add this to the function that >> bridges classes to Python... it doesn't work. > > So you can't do it by adding list as a base but could you instead just > not use ObjCObject to do the wrapping? What if you created another > class with list as the only base? You can't slam PyListObject and > ObjCObject together but could you subclass list and add real_object as > another variable? Or will python not even let you subclass compiled > classes in C? That would work, but then NSArray would no longer by a subclass of NSObject. This will probably cause subtle bugs and won't buy us much in the long run. Especially because this will be a non-issue in Python 2.3: I filed a bug-report related to this and the bug was fixed within a day :-) Ronald |