diff --git a/bson/binary.py b/bson/binary.py index 7814bf49fb..7f8dd69431 100644 --- a/bson/binary.py +++ b/bson/binary.py @@ -17,7 +17,7 @@ import warnings from collections.abc import Sequence from enum import Enum -from typing import TYPE_CHECKING, Any, overload +from typing import TYPE_CHECKING, Any, Self, overload from uuid import UUID """Tools for representing BSON binary data. @@ -310,10 +310,10 @@ class Binary(bytes): __subtype: int def __new__( - cls: type[Binary], + cls, data: memoryview | bytes | bytearray | _mmap | _array[Any], subtype: int = BINARY_SUBTYPE, - ) -> Binary: + ) -> Self: if not isinstance(subtype, int): raise TypeError(f"subtype must be an instance of int, not {type(subtype)}") if subtype >= 256 or subtype < 0: diff --git a/bson/code.py b/bson/code.py index 4c0289cada..60193e12f5 100644 --- a/bson/code.py +++ b/bson/code.py @@ -18,7 +18,7 @@ from collections.abc import Mapping from collections.abc import Mapping as _Mapping -from typing import Any +from typing import Any, Self class Code(str): @@ -52,11 +52,11 @@ class Code(str): __scope: Mapping[str, Any] | None def __new__( - cls: type[Code], + cls, code: str | Code, scope: Mapping[str, Any] | None = None, **kwargs: Any, - ) -> Code: + ) -> Self: if not isinstance(code, str): raise TypeError(f"code must be an instance of str, not {type(code)}") diff --git a/bson/codec_options.py b/bson/codec_options.py index 662665f961..52df204042 100644 --- a/bson/codec_options.py +++ b/bson/codec_options.py @@ -26,6 +26,7 @@ Any, Generic, NamedTuple, + Self, cast, ) @@ -368,7 +369,7 @@ def __init__(self, *args, **kwargs): super().__init__() def __new__( - cls: type[CodecOptions], + cls, document_class: type[Mapping[str, Any]] | None = None, tz_aware: bool = False, uuid_representation: int | None = UuidRepresentation.UNSPECIFIED, @@ -376,7 +377,7 @@ def __new__( tzinfo: datetime.tzinfo | None = None, type_registry: TypeRegistry | None = None, datetime_conversion: DatetimeConversion | None = DatetimeConversion.DATETIME, - ) -> CodecOptions: + ) -> Self: doc_class = document_class or dict # Generic aliases like SON[str, Any] or dict[str, Any] aren't classes, so # resolve to their origin before the subclass check. issubclass() raises diff --git a/bson/json_util.py b/bson/json_util.py index 558bf04654..2cef3d9f03 100644 --- a/bson/json_util.py +++ b/bson/json_util.py @@ -115,6 +115,7 @@ from typing import ( TYPE_CHECKING, Any, + Self, cast, ) @@ -300,14 +301,14 @@ def __init__(self, *args: Any, **kwargs: Any): super().__init__() def __new__( - cls: type[JSONOptions], + cls, strict_number_long: bool | None = None, datetime_representation: int | None = None, strict_uuid: bool | None = None, json_mode: int = JSONMode.RELAXED, *args: Any, **kwargs: Any, - ) -> JSONOptions: + ) -> Self: kwargs["tz_aware"] = kwargs.get("tz_aware", False) if kwargs["tz_aware"]: kwargs["tzinfo"] = kwargs.get("tzinfo", utc) @@ -321,7 +322,7 @@ def __new__( "JSONOptions.datetime_representation must be one of LEGACY, " "NUMBERLONG, or ISO8601 from DatetimeRepresentation." ) - self = cast(JSONOptions, super().__new__(cls, *args, **kwargs)) + self = cast(Self, super().__new__(cls, *args, **kwargs)) if json_mode not in (JSONMode.LEGACY, JSONMode.RELAXED, JSONMode.CANONICAL): raise ValueError( "JSONOptions.json_mode must be one of LEGACY, RELAXED, or CANONICAL from JSONMode." diff --git a/bson/typings.py b/bson/typings.py index 3823182531..593cf2c73d 100644 --- a/bson/typings.py +++ b/bson/typings.py @@ -28,6 +28,6 @@ # Common Shared Types. _DocumentOut = Union[MutableMapping[str, Any], "RawBSONDocument"] -_DocumentType = TypeVar("_DocumentType", bound=Mapping[str, Any]) -_DocumentTypeArg = TypeVar("_DocumentTypeArg", bound=Mapping[str, Any]) +_DocumentType = TypeVar("_DocumentType", bound=Mapping[str, Any]) # noqa: PYI018 +_DocumentTypeArg = TypeVar("_DocumentTypeArg", bound=Mapping[str, Any]) # noqa: PYI018 _ReadableBuffer = Union[bytes, memoryview, bytearray, "mmap", "array"] # type: ignore[type-arg] diff --git a/gridfs/asynchronous/grid_file.py b/gridfs/asynchronous/grid_file.py index 52122fe1dc..a8a90ce1aa 100644 --- a/gridfs/asynchronous/grid_file.py +++ b/gridfs/asynchronous/grid_file.py @@ -22,7 +22,8 @@ import math from collections import abc from collections.abc import Iterable, Mapping -from typing import Any, NoReturn, cast +from types import TracebackType +from typing import Any, NoReturn, Self, cast from bson.int64 import Int64 from bson.objectid import ObjectId @@ -1438,11 +1439,16 @@ async def writelines(self, sequence: Iterable[Any]) -> None: def writeable(self) -> bool: return True - async def __aenter__(self) -> AsyncGridIn: + async def __aenter__(self) -> Self: """Support for the context manager protocol.""" return self - async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> Any: + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> Any: """Support for the context manager protocol. Close the file if no exceptions occur and allow exceptions to propagate. @@ -1796,13 +1802,18 @@ def writelines(self, lines: Any) -> NoReturn: def writable(self) -> bool: return False - async def __aenter__(self) -> AsyncGridOut: + async def __aenter__(self) -> Self: """Makes it possible to use :class:`AsyncGridOut` files with the async context manager protocol. """ return self - async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> Any: + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> Any: """Makes it possible to use :class:`AsyncGridOut` files with the async context manager protocol. """ diff --git a/gridfs/synchronous/grid_file.py b/gridfs/synchronous/grid_file.py index b3ce525cb1..99b805e447 100644 --- a/gridfs/synchronous/grid_file.py +++ b/gridfs/synchronous/grid_file.py @@ -22,7 +22,8 @@ import math from collections import abc from collections.abc import Iterable, Mapping -from typing import Any, NoReturn, cast +from types import TracebackType +from typing import Any, NoReturn, Self, cast from bson.int64 import Int64 from bson.objectid import ObjectId @@ -1420,11 +1421,16 @@ def writelines(self, sequence: Iterable[Any]) -> None: def writeable(self) -> bool: return True - def __enter__(self) -> GridIn: + def __enter__(self) -> Self: """Support for the context manager protocol.""" return self - def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> Any: + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> Any: """Support for the context manager protocol. Close the file if no exceptions occur and allow exceptions to propagate. @@ -1778,13 +1784,18 @@ def writelines(self, lines: Any) -> NoReturn: def writable(self) -> bool: return False - def __enter__(self) -> GridOut: + def __enter__(self) -> Self: """Makes it possible to use :class:`GridOut` files with the async context manager protocol. """ return self - def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> Any: + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> Any: """Makes it possible to use :class:`GridOut` files with the async context manager protocol. """ diff --git a/pymongo/_asyncio_lock.py b/pymongo/_asyncio_lock.py index 561bdcae11..481703f4bb 100644 --- a/pymongo/_asyncio_lock.py +++ b/pymongo/_asyncio_lock.py @@ -10,6 +10,7 @@ import threading from asyncio import events, exceptions from collections.abc import Coroutine +from types import TracebackType from typing import Any _global_lock = threading.Lock() @@ -37,7 +38,12 @@ async def __aenter__(self) -> None: # statement for locks. return - async def __aexit__(self, exc_type: Any, exc: Any, tb: Any) -> None: + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + tb: TracebackType | None, + ) -> None: self.release() # type: ignore[attr-defined] diff --git a/pymongo/_csot.py b/pymongo/_csot.py index edd9dd0e33..14402d3d02 100644 --- a/pymongo/_csot.py +++ b/pymongo/_csot.py @@ -23,6 +23,7 @@ from collections.abc import Callable, MutableMapping from contextlib import AbstractContextManager from contextvars import ContextVar, Token +from types import TracebackType from typing import TYPE_CHECKING, Any, TypeVar, cast if TYPE_CHECKING: @@ -90,7 +91,12 @@ def __enter__(self) -> None: rtt_token = RTT.set(0.0) self._tokens = (timeout_token, deadline_token, rtt_token) - def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: if self._tokens: timeout_token, deadline_token, rtt_token = self._tokens TIMEOUT.reset(timeout_token) diff --git a/pymongo/_op_id.py b/pymongo/_op_id.py index 311aceb5b7..1173d10c7f 100644 --- a/pymongo/_op_id.py +++ b/pymongo/_op_id.py @@ -24,6 +24,7 @@ from contextlib import AbstractContextManager from contextvars import ContextVar +from types import TracebackType from typing import Any OP_ID: ContextVar[int | None] = ContextVar("OP_ID", default=None) @@ -42,5 +43,10 @@ def __init__(self, op_id: int | None): def __enter__(self) -> None: self._token = OP_ID.set(self._op_id) - def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: OP_ID.reset(self._token) diff --git a/pymongo/asynchronous/change_stream.py b/pymongo/asynchronous/change_stream.py index daf0cdfd5b..aad9ffe385 100644 --- a/pymongo/asynchronous/change_stream.py +++ b/pymongo/asynchronous/change_stream.py @@ -16,7 +16,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any +from types import TracebackType +from typing import TYPE_CHECKING from bson import _bson_to_dict from pymongo import _csot @@ -246,7 +247,12 @@ async def try_next(self) -> _DocumentType | None: async def __aenter__(self) -> AsyncChangeStream[_DocumentType]: return self - async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: await self.close() diff --git a/pymongo/asynchronous/client_session.py b/pymongo/asynchronous/client_session.py index f5e95c8cdd..615e228671 100644 --- a/pymongo/asynchronous/client_session.py +++ b/pymongo/asynchronous/client_session.py @@ -144,6 +144,7 @@ from typing import ( TYPE_CHECKING, Any, + Self, TypeVar, ) @@ -197,7 +198,12 @@ async def __aenter__(self) -> AsyncClientSession: self._session_token = _SESSION.set(self._session) # type: ignore[assignment] return self._session - async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: if self._session_token: _SESSION.reset(self._session_token) # type: ignore[arg-type] self._session_token = None @@ -211,7 +217,7 @@ class _TransactionContext: def __init__(self, session: AsyncClientSession): self.__session = session - async def __aenter__(self) -> _TransactionContext: + async def __aenter__(self) -> Self: return self async def __aexit__( @@ -292,10 +298,15 @@ async def _end_session(self, lock: bool) -> None: self._client._return_server_session(self._server_session) self._server_session = None - async def __aenter__(self) -> AsyncClientSession: + async def __aenter__(self) -> Self: return self - async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: await self._end_session(lock=True) async def with_transaction( diff --git a/pymongo/asynchronous/cursor_base.py b/pymongo/asynchronous/cursor_base.py index 3d6c879660..365ef7321a 100644 --- a/pymongo/asynchronous/cursor_base.py +++ b/pymongo/asynchronous/cursor_base.py @@ -18,6 +18,7 @@ from abc import abstractmethod from collections.abc import Mapping, Sequence +from types import TracebackType from typing import TYPE_CHECKING, Any, cast from pymongo import _csot @@ -187,7 +188,12 @@ async def close(self) -> None: """Explicitly close / kill this cursor.""" await self._die_lock() - async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: await self.close() @_csot.apply diff --git a/pymongo/asynchronous/encryption.py b/pymongo/asynchronous/encryption.py index e971226416..95d08a67bb 100644 --- a/pymongo/asynchronous/encryption.py +++ b/pymongo/asynchronous/encryption.py @@ -22,6 +22,7 @@ import weakref from collections.abc import AsyncGenerator, Mapping, MutableMapping, Sequence from copy import deepcopy +from types import TracebackType from typing import ( TYPE_CHECKING, Any, @@ -1160,7 +1161,12 @@ async def rewrap_many_data_key( async def __aenter__(self) -> AsyncClientEncryption[_DocumentType]: return self - async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: await self.close() def _check_closed(self) -> None: diff --git a/pymongo/asynchronous/mongo_client.py b/pymongo/asynchronous/mongo_client.py index 5eabd48e1c..63aae88662 100644 --- a/pymongo/asynchronous/mongo_client.py +++ b/pymongo/asynchronous/mongo_client.py @@ -1684,7 +1684,12 @@ def _database_default_options(self, name: str) -> database.AsyncDatabase: # typ async def __aenter__(self) -> AsyncMongoClient[_DocumentType]: return self - async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: await self.close() # See PYTHON-3084. diff --git a/pymongo/common.py b/pymongo/common.py index d3c392e4c1..156ebdaaba 100644 --- a/pymongo/common.py +++ b/pymongo/common.py @@ -27,6 +27,7 @@ TYPE_CHECKING, Any, NoReturn, + Self, overload, ) from urllib.parse import unquote_plus @@ -1111,7 +1112,7 @@ def has_c() -> bool: class Version(tuple[int, ...]): """A class that can be used to compare version strings.""" - def __new__(cls, *version: int) -> Version: + def __new__(cls, *version: int) -> Self: padded_version = cls._padded(version, 4) return super().__new__(cls, tuple(padded_version)) diff --git a/pymongo/cursor_shared.py b/pymongo/cursor_shared.py index a766e2a19c..73f4d51a72 100644 --- a/pymongo/cursor_shared.py +++ b/pymongo/cursor_shared.py @@ -68,7 +68,7 @@ def _split_message( return request_id, data, 0 -class _AgnosticCursorBase(Generic[_DocumentType], ABC): +class _AgnosticCursorBase(ABC, Generic[_DocumentType]): """ Shared IO-agnostic cursor base used by both async and sync cursor classes. All IO-specific behavior is implemented in subclasses. diff --git a/pymongo/database_shared.py b/pymongo/database_shared.py index 8bbf04f29c..e451f49478 100644 --- a/pymongo/database_shared.py +++ b/pymongo/database_shared.py @@ -33,4 +33,4 @@ def _check_name(name: str) -> None: raise InvalidName(f"database names cannot contain the character {invalid_char!r}") -_CodecDocumentType = TypeVar("_CodecDocumentType", bound=Mapping[str, Any]) +_CodecDocumentType = TypeVar("_CodecDocumentType", bound=Mapping[str, Any]) # noqa: PYI018 diff --git a/pymongo/driver_info.py b/pymongo/driver_info.py index 518347aa01..73a190c470 100644 --- a/pymongo/driver_info.py +++ b/pymongo/driver_info.py @@ -20,6 +20,7 @@ from __future__ import annotations from collections import namedtuple +from typing import Self class DriverInfo(namedtuple("DriverInfo", ["name", "version", "platform"])): @@ -38,9 +39,7 @@ class DriverInfo(namedtuple("DriverInfo", ["name", "version", "platform"])): :class:`ValueError` is raised if it does. """ - def __new__( - cls, name: str, version: str | None = None, platform: str | None = None - ) -> DriverInfo: + def __new__(cls, name: str, version: str | None = None, platform: str | None = None) -> Self: self = super().__new__(cls, name, version, platform) for key, value in self._asdict().items(): if value is not None and not isinstance(value, str): diff --git a/pymongo/lock.py b/pymongo/lock.py index a26c455212..9f844bf8e3 100644 --- a/pymongo/lock.py +++ b/pymongo/lock.py @@ -22,7 +22,7 @@ import threading import weakref from asyncio import wait_for -from typing import Any, TypeVar +from typing import Any import pymongo._asyncio_lock @@ -31,8 +31,6 @@ # References to instances of _create_lock _forkable_locks: weakref.WeakSet[threading.Lock] = weakref.WeakSet() -_T = TypeVar("_T") - # Needed to support 3.13 asyncio fixes (https://github.com/python/cpython/issues/112202) # in older versions of Python if sys.version_info >= (3, 13): diff --git a/pymongo/message.py b/pymongo/message.py index fc05015df8..d89b467a4a 100644 --- a/pymongo/message.py +++ b/pymongo/message.py @@ -30,6 +30,7 @@ TYPE_CHECKING, Any, NoReturn, + Self, ) import bson @@ -1433,7 +1434,7 @@ class _CursorAddress(tuple[Any, ...]): __namespace: Any - def __new__(cls, address: _Address, namespace: str) -> _CursorAddress: + def __new__(cls, address: _Address, namespace: str) -> Self: self = tuple.__new__(cls, address) self.__namespace = namespace return self diff --git a/pymongo/synchronous/change_stream.py b/pymongo/synchronous/change_stream.py index d4f15594ee..e5bc5971ce 100644 --- a/pymongo/synchronous/change_stream.py +++ b/pymongo/synchronous/change_stream.py @@ -16,7 +16,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any +from types import TracebackType +from typing import TYPE_CHECKING from bson import _bson_to_dict from pymongo import _csot @@ -246,7 +247,12 @@ def try_next(self) -> _DocumentType | None: def __enter__(self) -> ChangeStream[_DocumentType]: return self - def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: self.close() diff --git a/pymongo/synchronous/client_session.py b/pymongo/synchronous/client_session.py index 8e357c72b8..ba7ee39450 100644 --- a/pymongo/synchronous/client_session.py +++ b/pymongo/synchronous/client_session.py @@ -143,6 +143,7 @@ from typing import ( TYPE_CHECKING, Any, + Self, TypeVar, ) @@ -196,7 +197,12 @@ def __enter__(self) -> ClientSession: self._session_token = _SESSION.set(self._session) # type: ignore[assignment] return self._session - def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: if self._session_token: _SESSION.reset(self._session_token) # type: ignore[arg-type] self._session_token = None @@ -210,7 +216,7 @@ class _TransactionContext: def __init__(self, session: ClientSession): self.__session = session - def __enter__(self) -> _TransactionContext: + def __enter__(self) -> Self: return self def __exit__( @@ -289,10 +295,15 @@ def _end_session(self, lock: bool) -> None: self._client._return_server_session(self._server_session) self._server_session = None - def __enter__(self) -> ClientSession: + def __enter__(self) -> Self: return self - def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: self._end_session(lock=True) def with_transaction( diff --git a/pymongo/synchronous/cursor_base.py b/pymongo/synchronous/cursor_base.py index 70ba49f999..314ddd562d 100644 --- a/pymongo/synchronous/cursor_base.py +++ b/pymongo/synchronous/cursor_base.py @@ -18,6 +18,7 @@ from abc import abstractmethod from collections.abc import Mapping, Sequence +from types import TracebackType from typing import TYPE_CHECKING, Any, cast from pymongo import _csot @@ -187,7 +188,12 @@ def close(self) -> None: """Explicitly close / kill this cursor.""" self._die_lock() - def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: self.close() @_csot.apply diff --git a/pymongo/synchronous/encryption.py b/pymongo/synchronous/encryption.py index 3b92f3f261..4eb9df0228 100644 --- a/pymongo/synchronous/encryption.py +++ b/pymongo/synchronous/encryption.py @@ -21,6 +21,7 @@ import weakref from collections.abc import Generator, Mapping, MutableMapping, Sequence from copy import deepcopy +from types import TracebackType from typing import ( TYPE_CHECKING, Any, @@ -1153,7 +1154,12 @@ def rewrap_many_data_key( def __enter__(self) -> ClientEncryption[_DocumentType]: return self - def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: self.close() def _check_closed(self) -> None: diff --git a/pymongo/synchronous/mongo_client.py b/pymongo/synchronous/mongo_client.py index 249bd54bbe..cebc6a5e94 100644 --- a/pymongo/synchronous/mongo_client.py +++ b/pymongo/synchronous/mongo_client.py @@ -1682,7 +1682,12 @@ def _database_default_options(self, name: str) -> database.Database: # type: ig def __enter__(self) -> MongoClient[_DocumentType]: return self - def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: self.close() # See PYTHON-3084. diff --git a/pyproject.toml b/pyproject.toml index 85d0a438fc..ae29fdaf8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -248,7 +248,6 @@ ignore = [ "BLE", # Broad `Except` exception catches (intentional) # These are all new defaults added in ruff 0.16.0. Individual tickets linked from PYTHON-5964 track enabling each one. "FURB", # refurb - "PYI", # flake8-pyi "TC", # flake8-type-checking "TRY", # tryceratops "INT", # flake8-gettext