Introduce a new set-based function stdlib_modules()#174
Introduce a new set-based function stdlib_modules()#174
stdlib_modules()#174Conversation
|
Thanks @AA-Turner! Makes sense to me. Do you have thoughts/opinions on deprecating the |
I would support deprecating, yes. I can't think of any good reasons to require a sorted list as first-class API. The outlier is
I'd also support this, version numbers are unending in their supply. If anything goes badly wrong, it would be fun to finally see a package use the PEP 440 Epoch marker! A |
|
warehouse currently uses Probably a relatively trivial replacement, but it'd be good to understand what API is better before it's removed. |
If I'm reading this right, the two should have equivalent characteristics in this case: |
|
@miketheman the other relevant part is here: if canonicalize_name(name) in STDLIB_PROHIBITED:
raise ProjectNameUnavailableStdlibError()This could probably be replaced by the proposed API in #120, because (I assume) all warehouse wants to check is that the proposed name does not attempt to inhabit any part of the stdlib namespace. Proof of concept: https://pypi.org/project/collections.tin_of_spam/ |
Follows on from #167, cc @woodruffw @miketheman
We introduce a new frozenset-based API,
stdlib_modules(), that takes the place ofstdlib_listfor loading the package data. Due to this, we can simplify the remaining functions by usingsorted()instdlib_listand removing thelru_cachedecorator.A