On Fri, Jun 1, 2012 at 7:17 AM, Mark Shannon <mark at 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4