Skip to content

support Protocols #161

@carljm

Description

@carljm

Subtasks (these do not all need to be completed before the alpha):

  • Understand Protocol-instance types as a different kind of type to other Instance types (structural types vs nominal types)
  • Implement subtyping and assignability relations between different structural types, and between structural types and nominal types
  • Emit errors on invalid Protocol class definitions
  • Emit errors on isinstance() and issubclass() runtime checks against Protocol classes that are not decorated with @runtime_checkable
  • Experiment with removing existing Type variants such as Type::AlwaysTruthy and replacing them with Protocol types

PRs:

Sub-issues

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions