python / typing_extensions

Backported and experimental type hints for Python
Other
446 stars 110 forks source link

match Buffer inheritance to cpython Buffer #502

Closed tungol closed 1 week ago

tungol commented 2 weeks ago

On 3.12+, collections.abc.Buffer uses metaclass=ABCMeta instead of inheriting from ABC. Is there a reason why typing_extensions.Buffer doesn't do the same?

In typeshed, typing_extensions.Buffer is Protocol, which means the stubs do have metaclass=ABCMeta but they don't inherit from abc.ABC, so this MR improves alignment with both typing.Buffer and the stubs.