3 ms·
I have to look up PIL every time I use it to remember if I install PIL and import pillow or install pillow and import PIL. Imports can be aliased, so why allow
by ziml77 2y ago
I have to look up PIL every time I use it to remember if I install PIL and import pillow or install pillow and import PIL.
Imports can be aliased, so why allow this mismatch at all? PyPI should have enforced that each package contains one top-level module whose name is identical to the name used to install it.
- woodruffw 2y agoImports can be aliased as bindings; they can't be aliased at the import machinery layer, which makes the PIL/pillow distinction necessary. The adjacent subthread has an example of this.
- cqqxo4zV46cp 2y agoStarting any sentence in 2024 with “PyPI should have…” is a pretty ridiculous premise. We learn things over time, and PyPI itself wasn’t exactly operating on a green field.
- remram 2y agoThere used to be a PIL, someone made a new compatible distribution. They had to use the same import name to be compatible with existing code, they had to pick another name on PyPI that wasn't taken. It's kind of an extreme case.