You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the type hint you have used for it. However the docstring of this function mentions it can support a whole lot of other types (from bytes, bytearray, memoryview, array etc.). The closest type hint which comes to my mind is _typeshed.ReadableBuffer for this.
The text was updated successfully, but these errors were encountered:
I used only bytes because until Python 3.10 the documentation says
typing.ByteString
This type represents the types bytes, bytearray, and memoryview of byte sequences.
As a shorthand for this type, bytes can be used to annotate arguments of any of the types mentioned above.
Since you mention PEP688 you can also use typing_extensions.Buffer. You will need to wait for a while tho, because even tho its present in typing_extensions, it isn't yet on typeshed. It will soon be
This is the type hint you have used for it. However the docstring of this function mentions it can support a whole lot of other types (from bytes, bytearray, memoryview, array etc.). The closest type hint which comes to my mind is
_typeshed.ReadableBuffer
for this.The text was updated successfully, but these errors were encountered: