Skip to content

Conversation

AA-Turner
Copy link
Contributor

cc @miketheman

Notionally it makes more sense to use a (frozen)set here, you can reconstruct the current representation via sorted(stdlib_set). However, stdlib_list() is a public function, so I've changed _stdlib_list_with_cache() to return a frozenset, and then used that in in_stdlib -- meaning we no longer need the LRU cache indirection.

A

Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

Nice, makes sense to me! I think I'd be 100% okay with changing the stdlib_list return type too -- I suspect it'll be okay given that they're both sequences, and IMO we have some incompat breathing room since we're still pre 1.0.

(But I'll let @miketheman opine on that as well, I think this PR can go ahead regardless.)

@woodruffw woodruffw merged commit 913bae7 into pypi:main Aug 15, 2025
10 checks passed
@AA-Turner
Copy link
Contributor Author

that they're both sequences

A frozenset isn't a sequence, you can't perform indexing operations on it. You could potentially create a new function for it, though (e.g. stdlib_names), which doesn't have 'list' in the name.

A

@AA-Turner AA-Turner deleted the frozenset branch August 15, 2025 04:01
@AA-Turner
Copy link
Contributor Author

Thanks for merging @woodruffw!

@woodruffw
Copy link
Member

A frozenset isn't a sequence, you can't perform indexing operations on it. You could potentially create a new function for it, though (e.g. stdlib_names), which doesn't have 'list' in the name.

Ah yeah, I was thinking iterable. But you make a good point about it not being indexable; I hadn't thought through that and that would be a non-trivial public API change.

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.

2 participants