FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix Any overloads for inspect() raiseerr handling by princejain756 · Pull Request #13710 · sqlalchemy/sqlalchemy · GitHub

Repository navigation

Fix Any overloads for inspect() raiseerr handling - #13710

Open
princejain756 wants to merge 2 commits into
sqlalchemy:mainfrom
princejain756:fix-13704-inspect-overloads
Open

princejain756 wants to merge 2 commits into
sqlalchemy:mainfrom
princejain756:fix-13704-inspect-overloads

Conversation

Copy link
Copy Markdown

Fixes

Fixes: #13704

Description

Update the fallback @overload signatures for inspect(subject: Any, ...) in lib/sqlalchemy/inspection.py so the default raiseerr: Literal[True] = ... -> Any overload precedes raiseerr: bool -> Optional[Any]:

  • Calling inspect(obj) with raiseerr omitted or True now resolves to Any instead of Any | None.
  • Calling inspect(obj, raiseerr=flag) with False or a bool variable now resolves to Optional[Any] (Any | None).
  • Extend test/typing/plain_files/inspection_inspect.py to cover omitted raiseerr, literal booleans, and a bool parameter on a Protocol-typed subject.

Copy link
Copy Markdown
Collaborator

Thanks! Issue #13704 is now marked code review in progress and no longer open for pull requests, so this pull request holds the review for it and another one won't land on top of your work. If this pull request is abandoned, a maintainer can put open for pull requests back on #13704 to reopen it to others.

CaselIT commented Oct 21, 2026

Copy link
Copy Markdown
Member

thanks, looks ok!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inspect overloads for Any handle raiseerr wrong

3 participants


Back | FazBrowse Home | New Git URL