Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat: add a key argument to SpecifierSet.filter()#1068

Merged
henryiii merged 5 commits into
pypa:mainpypa/packaging:mainfrom
frostming:frostming/issue1066frostming/packaging:frostming/issue1066Copy head branch name to clipboard
Jan 23, 2026
Merged

feat: add a key argument to SpecifierSet.filter()#1068
henryiii merged 5 commits into
pypa:mainpypa/packaging:mainfrom
frostming:frostming/issue1066frostming/packaging:frostming/issue1066Copy head branch name to clipboard

Conversation

@frostming

Copy link
Copy Markdown
Contributor

Close #1066

Signed-off-by: Frost Ming me@frostming.com

Close pypa#1066

Signed-off-by: Frost Ming <me@frostming.com>
@frostming
frostming force-pushed the frostming/issue1066 branch from 6641730 to 104ebf9 Compare January 23, 2026 02:20
…lasses

Signed-off-by: Frost Ming <me@frostming.com>
@frostming
frostming force-pushed the frostming/issue1066 branch from 104ebf9 to dc58940 Compare January 23, 2026 02:25
Comment thread src/packaging/specifiers.py Outdated

@henryiii henryiii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the TYPE_CHECKING should be removed, overloads just get replaced at runtime anyway, but otherwise looks good to me, nicely typed.

frostming and others added 2 commits January 23, 2026 12:06
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@henryiii

Copy link
Copy Markdown
Contributor

I pushed a minor stylistic change to better match some other code.

Comment thread src/packaging/specifiers.py Outdated
…methods

Signed-off-by: Frost Ming <me@frostming.com>

@notatallshaw notatallshaw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

It's annoying that type hinters don't validate the overload signatures against the body of the actual method. But this is the best way to represent the type signature.

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.

[Feature Request] Consider adding a key argument to SpecifierSet.filter()

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.