Re: [Pyobjc-dev] posing
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-01-18 07:57:46
|
On Saturday, Jan 18, 2003, at 01:52 Europe/Amsterdam, bb...@ma... wrote: > I committed a test case that tests if poseAsClass: allows a Python > implemented subclass of an Objective-C object to pose as the > Objective-C superclass. > > It currently doesn't because Python based subclasses of Objective-C > classes *always* add at least one instance variable. Causes a fatal > error. > > Specifically (from class-builder.m): > > /* We add 1 instance variable to hybrid objective-C/Python classes, > this > * contains the reference to the python half of the class. Name should > be > * not be used by Objective-C classes that are not managed by PyObjC... > */ > static char pyobj_ivar[] = "__pyobjc_obj__"; > > I'm going to try modifying the way this all works a bit. Specifically: > > - add the method +(BOOL)__pyobjc__hasPythonImplementation to > NSObject; returns NO. A -(PyObject*)__pyobjc_pythonImplementation is probably more usefull in the long run (return NULL in NSObject, the equivalent of the current self.__pyobjc_objc__ in mixed classes and the bridged python object in OC_PythonObject and friends) Ronald |