Hacker News new | past | comments | ask | show | jobs | submit login

How is it not well defined in Python?



Well it would work just fine, but you'd always end up requiring the external dependency even if you didn't need to.

For example, let's say there was a new urllib released (its still called urllib). It's now version 2.0, but the stdlib version is 1.0.

If your package said "I need urllib==1.0", it would have know way of understanding that the version was already included within the standard library.

That said, it would download the correct package (assuming it existed) and work just fine.


> it would have know way of understanding that the version was already included within the standard library

Other than by introspecting which packages are installed, that is. Most of them will have a VERSION, __version__ or _version attribute which tells you.


This is available via the pkg-info in all installed packages; iirc version is required for distutils, and there is pep386 for version number format, so it should be possible to determine version number as well as compare them for all well-behaved packages. There is even a package which will find and parse pkg-info for an installed package called pkginfo:

http://pypi.python.org/pypi/pkginfo


GP was talking about built in modules in the standard library. I don't think they use distutils, but many of them still have some sort of version number.


Since it would work just fine, what is the problem you are trying to solve? Having to download too much stuff?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: