beeware / beeware/rubicon-objc
Protocol support
- Dominant language
- Python
- Stars
- 301
- Forks
- 70
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 18
Description
We should support working with Objective-C protocols.
* [x] There should be an `ObjCProtocol` class to look up protocols by name, similar to `ObjCClass`.
* [x] `ObjCProtocol` instances should provide basic properties like name and list of superprotocols.
* [x] Protocol conformance should be checkable using `isinstance`/`issubclass` (#68).
* [x] Objective-C subclasses created in Python should be able to conform to protocols (by adding them to the supertype list).
* [ ] This should check that all required methods and properties are implemented by the subclass. (Maybe the runtime does this already, but since it only communicates errors as boolean return values, we should provide better error messages ourselves.)
* [ ] This could be used to infer method signatures. That is, when the subclass includes a method with the same name as one in a protocol (or superclass), and the method implementation has no parameter/return annotations, the types should be inherited from the superclass/protocol.
* [x] Users should be able to create Objective-C protocols from Python using class syntax.
* [x] How should method declarations look? Regular Python method syntax with type annotations, and method bodies are ignored?
Contributor guide
Assessment
This issue has not been assessed yet.