On 4/5/2011 11:52 AM, Barry Warsaw wrote:
#. Module version numbers SHOULD conform to the normalized version
   format specified in PEP 386 [6]_.
From PEP 386:


Distutils will deprecate its existing versions class in favor of NormalizedVersion. The verlib module presented in this PEP will be renamed to version and placed into the distutils package.

With more standardization of versions, should the version module be promoted to stdlib directly?

On 4/5/2011 11:52 AM, Barry Warsaw wrote:
    DEFAULT_VERSION_RE = re.compile(r'(?P<version>\d+\.\d(?:\.\d+)?)')
    __version__ = pkgutil.get_distribution('elle').metadata['version']

The RE as given won't match alpha, beta, rc, dev, and post suffixes that are discussed in POP 386.

Nor will it match the code shown and quoted for the alternative distutils2 case.

Other comments:

Are there issues for finding and loading multiple versions of the same module?

Should it be possible to determine a version before loading a module?  If yes, the version module would have to be able to find a parse version strings in any of the many places this PEP suggests they could be... so that would be somewhat complex, but the complexity shouldn't be used to change the answer... but if the answer is yes, it might encourage fewer variant cases to be supported for acceptable version definition locations for this PEP.