Open ronaldoussoren opened 2 years ago
Another challenge is "objc.lookUpClass", its result is a particular type. For now I have it return objc_object, but requires more tweaks in pyobjc-core to work properly...
I'm not sure how to handle this without writing a mypy plugin, or keeping the current mess of casting.
The first step for adding typing support to all of PyObjC is to add typing support for PyObjC-core:
objc._objc
Lib/
.Some challenges in all of this:
@classmethod
in type stubs. The challenge there is that there are some ObjC methods that are valid both as class and instance methods, such as+[NSObject description]
and-[NSObject description]
.@protocol
in Objective-C) need some kind of named representation for typing, in particular to deal with methods that return or accept a type conforming to a protocol, e.g.-(id <NSCopying> returnCopyableObject;
. This is less critical for pyobjc-core. #419