Skip to content

byte-string-usage (PYI057)#

Derived from the flake8-pyi linter.

This rule is unstable and in preview. The --preview flag is required for use.

What it does#

Checks for uses of typing.ByteString or

Why is this bad?#

ByteString has been deprecated since Python 3.9 and will be removed in Python 3.14. The Python documentation recommends using either (or the typing_extensions backport on Python <3.12) or a union like bytes | bytearray | memoryview instead.


from typing import ByteString

Use instead:

from import Buffer