◐ Shell
clean mode source ↗

gh-91896: Revert some very noisy DeprecationWarnings for `ByteString` by AlexWaygood · Pull Request #104424 · python/cpython

Yeah, it's pretty frustrating that there isn't a better way of doing this :(

And this only happens because collections.abc and typing are following "best practices" and defining __all__. from ast import * doesn't cause any deprecation warnings to be emitted, even after 376137f, because ast doesn't define __all__, so the * import just looks at what's in globals(), and the module-level __getattr__ method is never triggered.

It feels somewhat perverse that defining __all__ makes life more difficult here :(