From 64e765215d01f9f5eea34f569f143ebad3d0865d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 13 May 2025 11:28:25 -0400 Subject: [PATCH] remove __getattr__ from root Removed ``__getattr__()`` rule from ``sqlalchemy/__init__.py`` that appeared to be trying to correct for a previous typographical error in the imports. This rule interferes with type checking and is removed. Fixes: #12588 Change-Id: I682b1f3c13b842d6f43ed02d28d9774b55477516 (cherry picked from commit c3f1ea62286a0b038482437923c4d1c53d668dcb) --- doc/build/changelog/unreleased_20/12588.rst | 8 ++++++++ lib/sqlalchemy/__init__.py | 11 ----------- 2 files changed, 8 insertions(+), 11 deletions(-) create mode 100644 doc/build/changelog/unreleased_20/12588.rst diff --git a/doc/build/changelog/unreleased_20/12588.rst b/doc/build/changelog/unreleased_20/12588.rst new file mode 100644 index 0000000000..2d30a768f7 --- /dev/null +++ b/doc/build/changelog/unreleased_20/12588.rst @@ -0,0 +1,8 @@ +.. change:: + :tags: bug, typing + :tickets: 12588 + + Removed ``__getattr__()`` rule from ``sqlalchemy/__init__.py`` that + appeared to be trying to correct for a previous typographical error in the + imports. This rule interferes with type checking and is removed. + diff --git a/lib/sqlalchemy/__init__.py b/lib/sqlalchemy/__init__.py index 71b701c920..748879e160 100644 --- a/lib/sqlalchemy/__init__.py +++ b/lib/sqlalchemy/__init__.py @@ -281,14 +281,3 @@ def __go(lcls: Any) -> None: __go(locals()) - - -def __getattr__(name: str) -> Any: - if name == "SingleonThreadPool": - _util.warn_deprecated( - "SingleonThreadPool was a typo in the v2 series. " - "Please use the correct SingletonThreadPool name.", - "2.0.24", - ) - return SingletonThreadPool - raise AttributeError(f"module {__name__!r} has no attribute {name!r}") -- 2.47.3