Skip to content

Track review of bytes types #9006

Open
Open

Description

@JelleZijlstra

I'll use this issue to track reviewing all usage of bytes types to see if they should be changed following #9001 and PEP 688. The below list is from git grep -c '\bbytes\b'.

My plan is to do look at each file one by one, reviewing bytes occurrences. I'll generally assume occurrences in return types or IO[bytes] are correct, but check occurrences in argument types to see if they should be ReadableBuffer, bytes, or similar.

  • stdlib/_ast.pyi (2 usages)
  • stdlib/_codecs.pyi (48 usages) _codecs: Fix buffer parameters #9003
  • stdlib/_compression.pyi (2 usages)
  • stdlib/_curses.pyi (19 usages) _curses: improve bytes handling #9007
  • stdlib/_imp.pyi (1 usages)
  • stdlib/_msi.pyi (2 usages) _msi: improve types #9008
  • stdlib/_posixsubprocess.pyi (2 usages) _posixsubprocess: improve types #9009
  • stdlib/_socket.pyi (17 usages) ssl, socket, array: Improve bytes handling #8997
  • stdlib/_tkinter.pyi (1 usages) _tcl: fix bytes usage #9010
  • stdlib/_typeshed/init.pyi (6 usages)
  • stdlib/_typeshed/wsgi.pyi (8 usages)
  • stdlib/_winapi.pyi (6 usages) _winapi: takes a ReadableBuffer #9011
  • stdlib/aifc.pyi (15 usages)
  • stdlib/antigravity.pyi (1 usages) antigravity: takes a ReadableBuffer #9012
  • stdlib/array.pyi (9 usages) ssl, socket, array: Improve bytes handling #8997, array: one more bad bytes type #9022
  • stdlib/ast.pyi (2 usages)
  • stdlib/asynchat.pyi (6 usages) (don't care, it's deprecated)
  • stdlib/asyncio/base_events.pyi (8 usages) asyncio: improve bytes handling #9013
  • stdlib/asyncio/base_subprocess.pyi (3 usages)
  • stdlib/asyncio/events.pyi (8 usages)
  • stdlib/asyncio/exceptions.pyi (2 usages)
  • stdlib/asyncio/protocols.pyi (3 usages)
  • stdlib/asyncio/sslproto.pyi (8 usages)
  • stdlib/asyncio/streams.pyi (11 usages)
  • stdlib/asyncio/subprocess.pyi (5 usages)
  • stdlib/asyncio/transports.pyi (3 usages)
  • stdlib/asyncio/trsock.pyi (17 usages)
  • stdlib/asyncio/windows_events.pyi (4 usages)
  • stdlib/asyncore.pyi (8 usages) asyncore: improve bytes handling #9034
  • stdlib/audioop.pyi (27 usages) (deprecated don't care)
  • stdlib/base64.pyi (22 usages) base64: fix a85decode param type #9014
  • stdlib/binascii.pyi (18 usages) binascii: Improve bytes types #7677
  • stdlib/binhex.pyi (6 usages) binhex: improve bytes handling #9035
  • stdlib/builtins.pyi (64 usages) builtins: improve bytes handling #9027
  • stdlib/bz2.pyi (12 usages) bz2: fix bytes parameters #9015
  • stdlib/cgi.pyi (9 usages) (deprecated don't care)
  • stdlib/cgitb.pyi (1 usages) (deprecated don't care)
  • stdlib/chunk.pyi (5 usages) (deprecated don't care)
  • stdlib/codecs.pyi (31 usages)
  • stdlib/collections/init.pyi (1 usages)
  • stdlib/ctypes/init.pyi (11 usages) ctypes: improve bytes handling #9029
  • stdlib/dbm/init.pyi (5 usages) dbm: fix bytes handling #9030
  • stdlib/dbm/dumb.pyi (6 usages)
  • stdlib/dbm/gnu.pyi (9 usages)
  • stdlib/dbm/ndbm.pyi (7 usages)
  • stdlib/difflib.pyi (8 usages) difflib: diff_bytes accepts bytearray #9031
  • stdlib/dis.pyi (1 usages) dis: fix types #9025
  • stdlib/distutils/command/bdist_wininst.pyi (1 usages) (deprecated don't care)
  • stdlib/email/init.pyi (2 usages) email: improve bytes handling #9032
  • stdlib/email/base64mime.pyi (4 usages)
  • stdlib/email/feedparser.pyi (1 usages)
  • stdlib/email/generator.pyi (2 usages)
  • stdlib/email/header.pyi (4 usages)
  • stdlib/email/message.pyi (3 usages)
  • stdlib/email/mime/application.pyi (1 usages)
  • stdlib/email/mime/audio.pyi (1 usages)
  • stdlib/email/mime/image.pyi (1 usages)
  • stdlib/email/parser.pyi (1 usages)
  • stdlib/email/policy.pyi (3 usages)
  • stdlib/email/quoprimime.pyi (5 usages)
  • stdlib/encodings/init.pyi (1 usages)
  • stdlib/encodings/utf_8.pyi (6 usages)
  • stdlib/encodings/utf_8_sig.pyi (6 usages)
  • stdlib/fcntl.pyi (3 usages) fcntl: fix fcntl arg type (s#) #9052
  • stdlib/fileinput.pyi (18 usages)
  • stdlib/ftplib.pyi (4 usages)
  • stdlib/genericpath.pyi (1 usages)
  • stdlib/gettext.pyi (1 usages)
  • stdlib/glob.pyi (1 usages)
  • stdlib/gzip.pyi (12 usages) gzip: improve bytes handling #9037
  • stdlib/hashlib.pyi (4 usages)
  • stdlib/hmac.pyi (8 usages) hmac: improve bytes handling #9046 hmac: also support bytearray in 3.7 branch #9054
  • stdlib/http/client.pyi (8 usages) http: improve types #9055
  • stdlib/http/server.pyi (2 usages)
  • stdlib/imaplib.pyi (21 usages) imaplib: fix bytes usage #9021, imaplib: _Authenticator also works with bytearray #9056
  • stdlib/imghdr.pyi (3 usages) (deprecated don't care)
  • stdlib/imp.pyi (2 usages) (deprecated don't care)
  • stdlib/importlib/abc.pyi (7 usages) importlib: improve bytes handling #9070
  • stdlib/importlib/machinery.pyi (3 usages)
  • stdlib/importlib/metadata/init.pyi (1 usages)
  • stdlib/importlib/resources.pyi (1 usages)
  • stdlib/importlib/util.pyi (3 usages)
  • stdlib/io.pyi (17 usages) io: improve bytes handling #9059
  • stdlib/ipaddress.pyi (4 usages)
  • stdlib/json/init.pyi (3 usages) json: improve bytes handling #9042
  • stdlib/json/encoder.pyi (1 usages)
  • stdlib/logging/config.pyi (1 usages)
  • stdlib/logging/handlers.pyi (2 usages) logging: StreamHandler.send takes ReadableBuffer #9057
  • stdlib/lzma.pyi (12 usages)
  • stdlib/macpath.pyi (1 usages)
  • stdlib/mailbox.pyi (12 usages) mailbox: improve bytes handling #9083
  • stdlib/marshal.pyi (2 usages) marshal: improve bytes handling #9047
  • stdlib/mmap.pyi (4 usages)
  • stdlib/msvcrt.pyi (4 usages) msvcrt: improve bytes handling #9071
  • stdlib/multiprocessing/connection.pyi (6 usages) multiprocessing: improve bytes handling #9085
  • stdlib/multiprocessing/managers.pyi (9 usages)
  • stdlib/multiprocessing/process.pyi (1 usages)
  • stdlib/multiprocessing/shared_memory.pyi (1 usages)
  • stdlib/multiprocessing/sharedctypes.pyi (2 usages)
  • stdlib/multiprocessing/util.pyi (2 usages)
  • stdlib/nntplib.pyi (5 usages) (deprecated don't care)
  • stdlib/ntpath.pyi (1 usages)
  • stdlib/os/init.pyi (28 usages) os: improve bytes handling #9072
  • stdlib/pathlib.pyi (5 usages) (Improve types and bytes usage of pathlib #9016)
  • stdlib/pickle.pyi (76 usages)
  • stdlib/pickletools.pyi (27 usages) pickletools: accepts bytearray #9073
  • stdlib/pkgutil.pyi (2 usages)
  • stdlib/plistlib.pyi (14 usages) plistlib: improve bytes handling #9048
  • stdlib/poplib.pyi (14 usages)
  • stdlib/posix.pyi (1 usages)
  • stdlib/posixpath.pyi (3 usages)
  • stdlib/pty.pyi (1 usages)
  • stdlib/pyexpat/init.pyi (3 usages) pyexpat: fix bytes usage #9017
  • stdlib/quopri.pyi (2 usages) quopri: improve types #9074
  • stdlib/random.pyi (2 usages)
  • stdlib/re.pyi (26 usages)
  • stdlib/secrets.pyi (1 usages)
  • stdlib/shelve.pyi (1 usages)
  • stdlib/shutil.pyi (2 usages)
  • stdlib/smtpd.pyi (5 usages) (deprecated don't care)
  • stdlib/smtplib.pyi (19 usages) smtplib: Improve bytes handling #9094
  • stdlib/socket.pyi (7 usages) ssl, socket, array: Improve bytes handling #8997, socket: constructor accepts bytes on Windows #9095
  • stdlib/socketserver.pyi (4 usages) socketserver: improve bytes handling #9096
  • stdlib/sqlite3/dbapi2.pyi (4 usages) sqlite3: Blob.write accepts buffer #9097
  • stdlib/sre_compile.pyi (1 usages)
  • stdlib/sre_constants.pyi (2 usages)
  • stdlib/sre_parse.pyi (4 usages)
  • stdlib/ssl.pyi (27 usages)
  • stdlib/struct.pyi (8 usages)
  • stdlib/subprocess.pyi (22 usages) subprocess: Improve bytes-related types #9100
  • stdlib/sunau.pyi (6 usages) (deprecated don't care)
  • stdlib/tarfile.pyi (42 usages)
  • stdlib/telnetlib.pyi (85 usages) (deprecated don't care)
  • stdlib/tempfile.pyi (16 usages)
  • stdlib/termios.pyi (1 usages) termios: improve comments, add more constants #9101
  • stdlib/tkinter/init.pyi (3 usages)
  • stdlib/tkinter/colorchooser.pyi (2 usages)
  • stdlib/tokenize.pyi (4 usages)
  • stdlib/tomllib.pyi (1 usages)
  • stdlib/types.pyi (20 usages)
  • stdlib/typing.pyi (3 usages) typing: accept buffers in typing.IO.write #9084
  • stdlib/unicodedata.pyi (2 usages) unicodedata: accepts ReadOnlyBuffer #9106
  • stdlib/unittest/case.pyi (4 usages) unittest: cannot use bytes regexes #9107
  • stdlib/urllib/error.pyi (1 usages)
  • stdlib/urllib/parse.pyi (27 usages)
  • stdlib/urllib/request.pyi (37 usages)
  • stdlib/urllib/response.pyi (11 usages)
  • stdlib/uuid.pyi (4 usages)
  • stdlib/wave.pyi (2 usages)
  • stdlib/winsound.pyi (2 usages) winsound: accepts buffers #9108
  • stdlib/wsgiref/handlers.pyi (8 usages)
  • stdlib/wsgiref/headers.pyi (1 usages)
  • stdlib/wsgiref/simple_server.pyi (1 usages)
  • stdlib/wsgiref/types.pyi (8 usages)
  • stdlib/wsgiref/util.pyi (4 usages)
  • stdlib/wsgiref/validate.pyi (12 usages)
  • stdlib/xdrlib.pyi (15 usages) (deprecated don't care)
  • stdlib/xml/dom/minidom.pyi (2 usages) xml: improve bytes types #9110
  • stdlib/xml/dom/pulldom.pyi (3 usages)
  • stdlib/xml/etree/ElementInclude.pyi (1 usages)
  • stdlib/xml/etree/ElementTree.pyi (17 usages)
  • stdlib/xml/sax/init.pyi (2 usages)
  • stdlib/xmlrpc/client.pyi (14 usages)
  • stdlib/xmlrpc/server.pyi (2 usages)
  • stdlib/zipfile.pyi (31 usages) zipfile: improve bytes handling #9109
  • stdlib/zipimport.pyi (1 usages)
  • stdlib/zlib.pyi (13 usages) zlib: improve bytes handling #9036
  • stdlib/zoneinfo/init.pyi (1 usages)
  • stubs/JACK-Client/jack/init.pyi (9 usages)
  • stubs/Markdown/markdown/core.pyi (2 usages)
  • stubs/Pillow/PIL/FtexImagePlugin.pyi (1 usages)
  • stubs/Pillow/PIL/Image.pyi (10 usages)
  • stubs/Pillow/PIL/ImageDraw.pyi (7 usages)
  • stubs/Pillow/PIL/ImageFont.pyi (17 usages)
  • stubs/Pillow/PIL/ImagePalette.pyi (1 usages)
  • stubs/Pillow/PIL/ImageQt.pyi (1 usages)
  • stubs/Pillow/PIL/PSDraw.pyi (6 usages)
  • stubs/Pillow/PIL/PdfParser.pyi (11 usages)
  • stubs/Pillow/PIL/PngImagePlugin.pyi (1 usages)
  • stubs/Pillow/PIL/PpmImagePlugin.pyi (1 usages)
  • stubs/Pillow/PIL/TiffImagePlugin.pyi (4 usages)
  • stubs/Pillow/PIL/WalImageFile.pyi (1 usages)
  • stubs/Pillow/PIL/XVThumbImagePlugin.pyi (1 usages)
  • stubs/Pillow/PIL/XpmImagePlugin.pyi (1 usages)
  • stubs/PyMySQL/pymysql/init.pyi (1 usages)
  • stubs/PyMySQL/pymysql/connections.pyi (6 usages)
  • stubs/PyMySQL/pymysql/converters.pyi (7 usages)
  • stubs/PyYAML/yaml/init.pyi (1 usages)
  • stubs/PyYAML/yaml/_yaml.pyi (1 usages)
  • stubs/PyYAML/yaml/constructor.pyi (1 usages)
  • stubs/PyYAML/yaml/cyaml.pyi (6 usages)
  • stubs/PyYAML/yaml/emitter.pyi (1 usages)
  • stubs/PyYAML/yaml/reader.pyi (2 usages)
  • stubs/PyYAML/yaml/representer.pyi (1 usages) yaml: allow ReadableBuffer in represent_binary #9701
  • stubs/Pygments/pygments/init.pyi (1 usages)
  • stubs/Pygments/pygments/formatter.pyi (3 usages)
  • stubs/Pygments/pygments/formatters/bbcode.pyi (1 usages)
  • stubs/Pygments/pygments/formatters/html.pyi (1 usages)
  • stubs/Pygments/pygments/formatters/img.pyi (1 usages)
  • stubs/Pygments/pygments/formatters/irc.pyi (1 usages)
  • stubs/Pygments/pygments/formatters/latex.pyi (1 usages)
  • stubs/Pygments/pygments/formatters/other.pyi (1 usages)
  • stubs/Pygments/pygments/formatters/pangomarkup.pyi (1 usages)
  • stubs/Pygments/pygments/formatters/rtf.pyi (1 usages)
  • stubs/Pygments/pygments/formatters/svg.pyi (1 usages)
  • stubs/Pygments/pygments/formatters/terminal.pyi (1 usages)
  • stubs/Pygments/pygments/formatters/terminal256.pyi (1 usages)
  • stubs/Pygments/pygments/lexers/init.pyi (3 usages)
  • stubs/SQLAlchemy/sqlalchemy/util/compat.pyi (1 usages)
  • stubs/Send2Trash/send2trash/compat.pyi (1 usages)
  • stubs/aiofiles/aiofiles/os.pyi (2 usages)
  • stubs/aiofiles/aiofiles/tempfile/init.pyi (2 usages)
  • stubs/aiofiles/aiofiles/threadpool/binary.pyi (7 usages)
  • stubs/beautifulsoup4/bs4/init.pyi (1 usages)
  • stubs/beautifulsoup4/bs4/dammit.pyi (4 usages)
  • stubs/beautifulsoup4/bs4/element.pyi (6 usages)
  • stubs/boto/boto/kms/layer1.pyi (3 usages)
  • stubs/boto/boto/s3/key.pyi (2 usages)
  • stubs/boto/boto/utils.pyi (5 usages)
  • stubs/braintree/braintree/resource.pyi (1 usages)
  • stubs/braintree/braintree/util/generator.pyi (1 usages)
  • stubs/braintree/braintree/util/parser.pyi (1 usages)
  • stubs/caldav/caldav/elements/base.pyi (2 usages)
  • stubs/cffi/_cffi_backend.pyi (4 usages)
  • stubs/cffi/cffi/api.pyi (2 usages)
  • stubs/chardet/chardet/init.pyi (2 usages)
  • stubs/chardet/chardet/universaldetector.pyi (4 usages)
  • stubs/croniter/croniter/croniter.pyi (3 usages)
  • stubs/cryptography/cryptography/fernet.pyi (12 usages)
  • stubs/cryptography/cryptography/hazmat/backends/interfaces.pyi (15 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/asymmetric/dh.pyi (4 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/asymmetric/dsa.pyi (5 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ec.pyi (8 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ed25519.pyi (6 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/asymmetric/ed448.pyi (6 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/asymmetric/padding.pyi (1 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/asymmetric/rsa.pyi (7 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/asymmetric/utils.pyi (2 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/asymmetric/x25519.pyi (5 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/asymmetric/x448.pyi (5 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/ciphers/init.pyi (6 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/ciphers/aead.pyi (12 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/ciphers/algorithms.pyi (10 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/ciphers/modes.pyi (19 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/cmac.pyi (3 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/constant_time.pyi (1 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/hashes.pyi (4 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/hmac.pyi (4 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/kdf/init.pyi (2 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/kdf/concatkdf.pyi (7 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/kdf/hkdf.pyi (6 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/kdf/kbkdf.pyi (5 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/kdf/pbkdf2.pyi (3 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/kdf/scrypt.pyi (3 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/kdf/x963kdf.pyi (3 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/keywrap.pyi (4 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/padding.pyi (2 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/poly1305.pyi (6 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/serialization/init.pyi (7 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/serialization/pkcs12.pyi (3 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/serialization/pkcs7.pyi (4 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/twofactor/hotp.pyi (3 usages)
  • stubs/cryptography/cryptography/hazmat/primitives/twofactor/totp.pyi (3 usages)
  • stubs/cryptography/cryptography/x509/init.pyi (26 usages)
  • stubs/docutils/docutils/io.pyi (9 usages)
  • stubs/fpdf2/fpdf/fpdf.pyi (4 usages)
  • stubs/fpdf2/fpdf/syntax.pyi (1 usages)
  • stubs/gdb/gdb/init.pyi (2 usages)
  • stubs/google-cloud-ndb/google/cloud/ndb/model.pyi (14 usages)
  • stubs/google-cloud-ndb/google/cloud/ndb/stats.pyi (1 usages)
  • stubs/hdbcli/hdbcli/dbapi.pyi (2 usages)
  • stubs/html5lib/html5lib/_inputstream.pyi (4 usages)
  • stubs/html5lib/html5lib/html5parser.pyi (2 usages)
  • stubs/html5lib/html5lib/serializer.pyi (3 usages)
  • stubs/ldap3/ldap3/core/connection.pyi (1 usages)
  • stubs/ldap3/ldap3/utils/conv.pyi (3 usages)
  • stubs/ldap3/ldap3/utils/ntlm.pyi (1 usages)
  • stubs/oauthlib/oauthlib/common.pyi (1 usages)
  • stubs/paho-mqtt/paho/mqtt/client.pyi (10 usages)
  • stubs/paho-mqtt/paho/mqtt/properties.pyi (12 usages)
  • stubs/paho-mqtt/paho/mqtt/publish.pyi (1 usages)
  • stubs/paho-mqtt/paho/mqtt/subscribeoptions.pyi (2 usages)
  • stubs/paramiko/paramiko/_winapi.pyi (2 usages)
  • stubs/paramiko/paramiko/agent.pyi (6 usages)
  • stubs/paramiko/paramiko/ber.pyi (6 usages)
  • stubs/paramiko/paramiko/channel.pyi (14 usages)
  • stubs/paramiko/paramiko/common.pyi (45 usages)
  • stubs/paramiko/paramiko/compress.pyi (2 usages)
  • stubs/paramiko/paramiko/dsskey.pyi (4 usages)
  • stubs/paramiko/paramiko/ecdsakey.pyi (4 usages)
  • stubs/paramiko/paramiko/ed25519key.pyi (4 usages)
  • stubs/paramiko/paramiko/file.pyi (1 usages)
  • stubs/paramiko/paramiko/kex_curve25519.pyi (2 usages)
  • stubs/paramiko/paramiko/kex_ecdh_nist.pyi (2 usages)
  • stubs/paramiko/paramiko/kex_gex.pyi (5 usages)
  • stubs/paramiko/paramiko/kex_group1.pyi (4 usages)
  • stubs/paramiko/paramiko/kex_gss.pyi (9 usages)
  • stubs/paramiko/paramiko/message.pyi (10 usages)
  • stubs/paramiko/paramiko/packet.pyi (5 usages)
  • stubs/paramiko/paramiko/pkey.pyi (7 usages)
  • stubs/paramiko/paramiko/proxy.pyi (2 usages)
  • stubs/paramiko/paramiko/py3compat.pyi (8 usages)
  • stubs/paramiko/paramiko/rsakey.pyi (4 usages)
  • stubs/paramiko/paramiko/server.pyi (4 usages)
  • stubs/paramiko/paramiko/sftp_attr.pyi (1 usages)
  • stubs/paramiko/paramiko/sftp_client.pyi (22 usages)
  • stubs/paramiko/paramiko/sftp_file.pyi (3 usages)
  • stubs/paramiko/paramiko/sftp_handle.pyi (2 usages)
  • stubs/paramiko/paramiko/sftp_server.pyi (2 usages)
  • stubs/paramiko/paramiko/ssh_gss.pyi (7 usages)
  • stubs/paramiko/paramiko/transport.pyi (4 usages)
  • stubs/paramiko/paramiko/util.pyi (6 usages)
  • stubs/paramiko/paramiko/win_openssh.pyi (2 usages)
  • stubs/paramiko/paramiko/win_pageant.pyi (2 usages)
  • stubs/passlib/passlib/context.pyi (9 usages)
  • stubs/passlib/passlib/handlers/django.pyi (2 usages)
  • stubs/passlib/passlib/handlers/fshp.pyi (2 usages)
  • stubs/passlib/passlib/handlers/misc.pyi (11 usages)
  • stubs/passlib/passlib/handlers/mssql.pyi (1 usages)
  • stubs/passlib/passlib/handlers/pbkdf2.pyi (1 usages)
  • stubs/passlib/passlib/handlers/phpass.pyi (1 usages)
  • stubs/passlib/passlib/handlers/sha1_crypt.pyi (1 usages)
  • stubs/passlib/passlib/handlers/sha2_crypt.pyi (1 usages)
  • stubs/passlib/passlib/handlers/sun_md5_crypt.pyi (1 usages)
  • stubs/passlib/passlib/ifc.pyi (6 usages)
  • stubs/passlib/passlib/utils/handlers.pyi (11 usages)
  • stubs/peewee/peewee.pyi (1 usages)
  • stubs/polib/polib.pyi (3 usages)
  • stubs/protobuf/google/protobuf/any_pb2.pyi (2 usages)
  • stubs/protobuf/google/protobuf/descriptor.pyi (1 usages)
  • stubs/protobuf/google/protobuf/descriptor_pb2.pyi (9 usages)
  • stubs/protobuf/google/protobuf/internal/containers.pyi (1 usages)
  • stubs/protobuf/google/protobuf/internal/decoder.pyi (1 usages)
  • stubs/protobuf/google/protobuf/internal/encoder.pyi (2 usages)
  • stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi (1 usages)
  • stubs/protobuf/google/protobuf/internal/extension_dict.pyi (1 usages)
  • stubs/protobuf/google/protobuf/json_format.pyi (1 usages)
  • stubs/protobuf/google/protobuf/message.pyi (5 usages)
  • stubs/protobuf/google/protobuf/text_format.pyi (7 usages)
  • stubs/protobuf/google/protobuf/type_pb2.pyi (2 usages)
  • stubs/protobuf/google/protobuf/wrappers_pb2.pyi (4 usages)
  • stubs/psycopg2/psycopg2/_psycopg.pyi (13 usages)
  • stubs/psycopg2/psycopg2/extensions.pyi (1 usages)
  • stubs/psycopg2/psycopg2/extras.pyi (9 usages)
  • stubs/pyOpenSSL/OpenSSL/SSL.pyi (24 usages)
  • stubs/pyOpenSSL/OpenSSL/crypto.pyi (42 usages)
  • stubs/pyOpenSSL/OpenSSL/rand.pyi (1 usages)
  • stubs/pyaudio/pyaudio.pyi (3 usages)
  • stubs/pycurl/pycurl.pyi (1 usages)
  • stubs/pyflakes/pyflakes/api.pyi (1 usages)
  • stubs/pyflakes/pyflakes/checker.pyi (2 usages)
  • stubs/pyinstaller/PyInstaller/compat.pyi (2 usages)
  • stubs/pysftp/pysftp/init.pyi (3 usages)
  • stubs/python-dateutil/dateutil/parser/init.pyi (1 usages)
  • stubs/python-dateutil/dateutil/parser/isoparser.pyi (3 usages)
  • stubs/python-dateutil/dateutil/tz/tz.pyi (1 usages)
  • stubs/python-jose/jose/backends/init.pyi (1 usages)
  • stubs/python-jose/jose/backends/base.pyi (9 usages)
  • stubs/python-jose/jose/backends/cryptography_backend.pyi (1 usages)
  • stubs/python-jose/jose/backends/ecdsa_backend.pyi (3 usages)
  • stubs/python-jose/jose/backends/native.pyi (6 usages)
  • stubs/python-jose/jose/backends/rsa_backend.pyi (7 usages)
  • stubs/python-jose/jose/constants.pyi (1 usages)
  • stubs/python-jose/jose/jwe.pyi (7 usages)
  • stubs/python-jose/jose/jwk.pyi (1 usages)
  • stubs/python-jose/jose/jws.pyi (5 usages)
  • stubs/python-jose/jose/jwt.pyi (3 usages)
  • stubs/python-jose/jose/utils.pyi (7 usages)
  • stubs/pywin32/isapi/threaded_extension.pyi (1 usages)
  • stubs/pywin32/pythoncom.pyi (1 usages)
  • stubs/pywin32/win32/timer.pyi (1 usages)
  • stubs/pywin32/win32/win32security.pyi (2 usages)
  • stubs/redis/redis/asyncio/client.pyi (7 usages)
  • stubs/redis/redis/asyncio/connection.pyi (11 usages)
  • stubs/redis/redis/asyncio/lock.pyi (5 usages)
  • stubs/redis/redis/client.pyi (9 usages)
  • stubs/redis/redis/commands/core.pyi (5 usages)
  • stubs/redis/redis/connection.pyi (14 usages)
  • stubs/redis/redis/lock.pyi (4 usages)
  • stubs/redis/redis/sentinel.pyi (1 usages)
  • stubs/redis/redis/typing.pyi (5 usages)
  • stubs/redis/redis/utils.pyi (2 usages)
  • stubs/regex/regex/_regex.pyi (28 usages)
  • stubs/regex/regex/regex.pyi (25 usages)
  • stubs/requests/@tests/test_cases/check_post.py (2 usages)
  • stubs/requests/requests/adapters.pyi (2 usages)
  • stubs/requests/requests/api.pyi (10 usages)
  • stubs/requests/requests/auth.pyi (1 usages)
  • stubs/requests/requests/compat.pyi (1 usages)
  • stubs/requests/requests/models.pyi (5 usages)
  • stubs/requests/requests/sessions.pyi (20 usages)
  • stubs/requests/requests/utils.pyi (1 usages)
  • stubs/setuptools/pkg_resources/init.pyi (4 usages)
  • stubs/simplejson/simplejson/init.pyi (1 usages)
  • stubs/six/six/init.pyi (9 usages)
  • stubs/stripe/stripe/webhook.pyi (2 usages)
  • stubs/toml/toml/decoder.pyi (1 usages)
  • stubs/tqdm/tqdm/std.pyi (1 usages)
  • stubs/tree-sitter/tree_sitter/binding.pyi (3 usages)
  • stubs/typed-ast/typed_ast/ast27.pyi (3 usages) typed-ast: fix get_docstring, allow buffer #9019
  • stubs/typed-ast/typed_ast/ast3.pyi (2 usages) typed-ast: fix get_docstring, allow buffer #9019
  • stubs/urllib3/urllib3/exceptions.pyi (4 usages)
  • stubs/urllib3/urllib3/fields.pyi (1 usages)
  • stubs/urllib3/urllib3/response.pyi (11 usages)
  • stubs/vobject/vobject/base.pyi (1 usages)
  • stubs/vobject/vobject/icalendar.pyi (1 usages)
  • stubs/waitress/waitress/buffers.pyi (7 usages)
  • stubs/waitress/waitress/channel.pyi (2 usages)
  • stubs/waitress/waitress/compat.pyi (2 usages)
  • stubs/waitress/waitress/parser.pyi (7 usages)
  • stubs/waitress/waitress/receiver.pyi (5 usages)
  • stubs/waitress/waitress/task.pyi (2 usages)
  • stubs/waitress/waitress/utilities.pyi (1 usages)
  • stubs/waitress/waitress/wasyncore.pyi (8 usages)
  • stubs/xmltodict/xmltodict.pyi (2 usages) xmltodict: improve parse input types #9018
  • stubs/xxhash/xxhash/init.pyi (4 usages) (obsolete)

Activity

  1. hauntsaninja commented on Oct 28, 2022

    @hauntsaninja
    Collaborator

    One quick note: I believe we're missing a type that corresponds to Buffer & Sequence[int]. If such a type is ever needed and PEP 688 is accepted and we alias the buffer types in typeshed to types.Buffer, we'll get false negatives. So possibly a thing to look out for and introduce if necessary (_typeshed.ByteSequence?)

  2. AlexWaygood commented on Oct 28, 2022

    @AlexWaygood
    Member

    (I wouldn't waste time wading through all the cryptography ones, given how out of date those stubs are — we should just work on getting #5768 done so that we can do #5618.)

  3. JelleZijlstra commented on Oct 28, 2022

    @JelleZijlstra
    MemberAuthor

    @hauntsaninja so far I haven't seen much use for that; usually people either want some subset or Sequence, or the buffer protocol, but not both.

    @AlexWaygood thanks, that saves a lot of files.

    I'm also going to skip all of the deleted and deprecated modules (e.g. from PEP 594) since they're unlikely to affect real users.

  4. AlexWaygood commented on Oct 28, 2022

    @AlexWaygood
    Member

    I've ticked off stubs/xxhash/xxhash/__init__.pyi for you as well, since those stubs are obsolete and scheduled for removal (#7142)

  5. JelleZijlstra commented on Nov 6, 2022

    @JelleZijlstra
    MemberAuthor

    I am going to stop sending PRs for now since I have >10 open PRs. I'd appreciate reviews on the open ones. :)

  6. added a commit that references this issue on Apr 29, 2023
  7. AlexWaygood commented on Apr 29, 2023

    @AlexWaygood
    Member

    I've ticked off the urllib3 ones, since our stubs for urllib3 are obsolete and scheduled for removal.

  8. added a commit that references this issue on Apr 29, 2023
  9. shininglove commented on Jun 5, 2023

    @shininglove

    Found an issue with stubs/requests/requests/models.pyi, seems its reporting the return type of Response.content to be bytes, but it seems its return type in the sourcecode is bytes | bool | None

    Not sure if this is intended or not. Can help with a PR for it

  10. JelleZijlstra commented on Jun 5, 2023

    @JelleZijlstra
    MemberAuthor

    Thanks for checking! Please open a PR (or a separate issue if you're not sure).

    I don't know if I'll get around to all the third-party stubs. For a lot of these files it doesn't seem like we're gaining that much by adjusting the bytes types.

  11. Akuli commented on Sep 6, 2023

    @Akuli
    Collaborator

    Checked the tree_sitter checkbox, no changes were needed since it only accepts bytes.

    Details
    >>> import tree_sitter_languages
    >>> p = tree_sitter_languages.get_parser('python')
    >>> p
    <tree_sitter.Parser object at 0x7f873b5e83d0>
    >>> p.parse(memoryview(b'print(1)'))
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: First argument to parse must be bytes
    >>> p.parse(bytearray(b'print(1)'))
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: First argument to parse must be bytes
    >>> p.parse(b'print(1)')
    <tree_sitter.Tree object at 0x7f873b5e83b0>
    
  12. Avasam commented on Oct 16, 2023

    @Avasam
    SponsorCollaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions