Protocol
should be documented as using ABCMeta
as metaclass
#127677
Labels
Protocol
should be documented as using ABCMeta
as metaclass
#127677
Documentation
Came up in #127648.
Currently the documentation for typing.Protocol doesn't mention that
Protocol
hasABCMeta
in its metaclasses (indirectly via_ProtocolMeta
) and that its methods can (should?) be marked with@abstractmethod
. In fact, neither the string "ABCMeta" nor "abstractmethod" appear in the documentation for thetyping
module.I also suggest to add
@abstractmethod
to the examples using aProtocol
as that is probably a best practice.Finally, the documentation for
Protocol
suggests to see PEP 544 for more details. I don't think this is particularly helpful. All information relevant for users should be in the main documentation. PEP 544 should only be suggested as a historical document. (And I don't suggest to directly link to the typing spec, either, although a general link at the top of the page would be useful.)The text was updated successfully, but these errors were encountered: