Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved typing for builtins #127

Merged
merged 4 commits into from Feb 15, 2024
Merged

Conversation

maxfischer2781
Copy link
Owner

@maxfischer2781 maxfischer2781 commented Feb 13, 2024

This PR overhauls the typing of the builtins module. Major changes include:

  • switched to stub file for modern typing support without typing_extensions at runtime
  • support various cases of narrowing T | None to T
  • various argument-less cases
  • filter callable...
    • ... may return any type (since anything converts to boolean)
    • ... may narrow via TypeGuard

@maxfischer2781 maxfischer2781 marked this pull request as ready for review February 13, 2024 17:47
@maxfischer2781 maxfischer2781 self-assigned this Feb 13, 2024
@maxfischer2781 maxfischer2781 merged commit 91c1f80 into master Feb 15, 2024
18 checks passed
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.

Add type overload with filter(None, iter)
1 participant