You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment ObjCClass extends ObjCInstance and type. As far as I can tell, the fact that it extends type is not used or needed for anything at the moment. A metaclass don't need to subclass type, it's enough to have its constructor accept the signature of type's constructor (name, bases, namespace).
It's also misleading, because users might expect to be able to define Python methods on Objective-C classes (by not decorating them with @objc_method). This is not possible at the moment, because instances of user-defined Objective-C classes are actually instances of ObjCInstance, and not of the user's ObjCClass subclass. We could theoretically support this though - similar to how an ObjC NSArray becomes a Python ObjCListInstance, we could make an ObjC UserSubclass become a Python UserSubclass too. (The logic in ObjCInstance._select_mixin would probably need to be optimized though, I don't think a chain of isKindOfClass: scales well.)
The text was updated successfully, but these errors were encountered:
At the moment
ObjCClass
extendsObjCInstance
andtype
. As far as I can tell, the fact that it extendstype
is not used or needed for anything at the moment. A metaclass don't need to subclasstype
, it's enough to have its constructor accept the signature oftype
's constructor (name, bases, namespace).It's also misleading, because users might expect to be able to define Python methods on Objective-C classes (by not decorating them with
@objc_method
). This is not possible at the moment, because instances of user-defined Objective-C classes are actually instances ofObjCInstance
, and not of the user'sObjCClass
subclass. We could theoretically support this though - similar to how an ObjCNSArray
becomes a PythonObjCListInstance
, we could make an ObjCUserSubclass
become a PythonUserSubclass
too. (The logic inObjCInstance._select_mixin
would probably need to be optimized though, I don't think a chain ofisKindOfClass:
scales well.)The text was updated successfully, but these errors were encountered: