On Fri, Jun 1, 2012 at 7:17 AM, Mark Shannon <m...@hotpy.org> wrote: > Previously you said that "it needs to handled in the implementation > language, and explicitly *not* in Python". > I asked why that was. > > Now you seem to be suggesting that Python code would break the DRY rule, > but the C code would not. If the C code can avoid duplication, then so > can the Python code, as follows: > > class SysImplementation: > > "Define __repr__(), etc here " > ... > > import imp > tag = imp.get_tag() > > sys.implementation = SysImplementation() > sys.implementation.name = tag[:tag.index('-')] > sys.implementation.version = sys.version_info > sys.implementation.hexversion = sys.hexversion > sys.implementation.cache_tag = tag
This was actually the big motivator for PEP 421. Once PEP 421 is final, imp.get_tag() will get its value from sys.implementation, rather than the other way around. The point is to pull the implementation-specific values into one place (as much as is reasonable). -eric _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com