Is there a top 100 package that does something funny on import?
Is there a top 100 package that does something funny on import?
My guess is that nearly all packages that did this sort of thing were left behind in the 2-to-3 migration, which a lot of us used as the excuse for a clean break.
But I agree that observable side effects are generally pretty rare. And apparently, both libraries are not even in the top 100 packages, depending on how you count. It looks like those spots are all taken by libraries used in uncached, wasteful CI workflows: https://hugovk.github.io/top-pypi-packages/
But still a bummer, to be sure. It's easy enough for me to say it doesn't count when I haven't been affected by it.
This is buried deep in the PyTorch docs and I don’t have the willpower to go find it right now, sorry.
import matplotlib
import PIL
im = PIL.Image.open("foo.png") import PIL.Image
Turns out that matplotlib (and probably lots of other stuff) does that, and then it gets resolved correctly.