Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol support #69

Open
6 of 8 tasks
dgelessus opened this issue Sep 17, 2017 · 1 comment
Open
6 of 8 tasks

Protocol support #69

dgelessus opened this issue Sep 17, 2017 · 1 comment
Labels
enhancement New features, or improvements to existing features.

Comments

@dgelessus
Copy link
Collaborator

dgelessus commented Sep 17, 2017

We should support working with Objective-C protocols.

  • There should be an ObjCProtocol class to look up protocols by name, similar to ObjCClass.
  • ObjCProtocol instances should provide basic properties like name and list of superprotocols.
  • Protocol conformance should be checkable using isinstance/issubclass (ObjCClass should support isinstance and issubclass #68).
  • 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.
  • Users should be able to create Objective-C protocols from Python using class syntax.
    • How should method declarations look? Regular Python method syntax with type annotations, and method bodies are ignored?
@dgelessus dgelessus added the enhancement New features, or improvements to existing features. label Sep 17, 2017
@freakboy3742
Copy link
Member

There's an overlap here between Objective-C protocols and Python ABCs - that might be a direction to take for implementation.

dgelessus added a commit to dgelessus/rubicon-objc that referenced this issue Oct 6, 2017
Currently this only supports looking up and inspecting protocols, not
creating new ones.
dgelessus added a commit to dgelessus/rubicon-objc that referenced this issue Oct 14, 2017
dgelessus added a commit to dgelessus/rubicon-objc that referenced this issue Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features.
Projects
None yet
Development

No branches or pull requests

2 participants