On 2/10/22 1:45 PM, Brett Cannon wrote: > Protocols would let folks rely on a common Path object API w/o having to require the object > come from pathlib itself or explicitly subclass something (which I admit would be rare, but > there's no reason to artificially constrain this either). Now maybe this is too broad of an > API for people to care, but since protocols are also ABCs it doesn't inherently make things > worse, either. So I would say subclassing Protocol makes sense while still using > abc.abstractmethod for methods people must implement.
Brett, when you say Protocol are you referring to static typing? In your earlier email I thought you were referring to building blocks such as _fs_path, or the __iter__ and __next__ protocols.
-- ~Ethan~ _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/HG6IF2YXGKXLYNZ7NNMZHU3UEQSFEHJ4/ Code of Conduct: http://python.org/psf/codeofconduct/