[Python-Dev] sys.implementation (original) (raw)
Barry Warsaw barry at python.org
Wed May 9 03:14:02 CEST 2012
- Previous message: [Python-Dev] c/ElementTree XML serialisation
- Next message: [Python-Dev] sys.implementation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Eric,
Great job on the latest PEP 421. I really like it. A few additional comments/questions.
sys.implementation.version
This is defined as the version of the implementation, while sys.version_info is the version of the language. The semantics of sys.version_info have been sufficiently squishy in the past, as the XXX implies. This PEP shouldn't try to untangle that, so I think it be better to represent both values explicitly in sys.implementation.
Adding new required variables. I'd claim that it's not unduly heavyweight to require a new PEP to add required variables to sys.implementation. That hypothetical PEP will have to include things like rationale, impact on other implementations, etc. That seems like enough to warrant a new PEP, even if it's relatively succinct.
I'd also make it clear that adding new variables to sys.implementation.metadata explicitly does not require a PEP.
In Example Metadata Value:
"If they later have meaningful uses cases, they can be added by following the process described in Adding New Required Attributes."
I'd rephrase this to "If these or any other variables are deemed to have meaningful use cases across all implementations, they can be moved or added to sys.implementation directly, following the process described in Adding New Required Attributes."
I mildly prefer sys.implementation.name to be lower cased. My intuition is that to be safe, most comparisons of the value will coerce to lower case, which is easy enough in Python, but perhaps a bit more of a pain in C. I don't feel really strongly about this though. (A counter argument is that the value might be printed, so a case-sensitive version would be better.)
Since I'm advocating to be explicit about the language version and the implementation version, .hexversion is probably also useful for both.
I've said before that I think the keys in sys.implementation should be locked down (i.e. not writable). I think sys.implementation.metadata should be the same type.
Cheers, -Barry
-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://mail.python.org/pipermail/python-dev/attachments/20120508/54a5a641/attachment.pgp>
- Previous message: [Python-Dev] c/ElementTree XML serialisation
- Next message: [Python-Dev] sys.implementation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]