New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a named tuple for sys.version_info #48535
Comments
sys.version_info is just asking for a named tuple consisting of major, This is assuming, of course, that bootstrapping doesn't get in the way. |
I concur that bootstrapping may be a problem. Using a NamedTuple also But we could reimplement it with a PyStructSequence like I did for |
Hello, my name is Ross Light. I've written a patch for this, but this This does pass all regression tests, but I did have to modify the |
You also need to add unit tests for the new behavior you've implemented. |
Oh yes, you're right. Sorry! |
+1 on this idea |
A couple of further comments:
|
Okay, here's a patch with the requested changes. You're right in saying |
Rather than deleting the isinstance() check from the tests completely, I self.assert_(isinstance(vi[:], tuple)) Also, comparing directly with a tuple is also a fairly common use of self.assert_(vi > (1,0,0)) Patch applied and built cleanly for me, but I haven't checked the doc |
Tests added and new patch uploaded. Anything else, anyone? |
The doc string for sys includes: I'm not sure changing this to "... as a structseq" makes it any more Other than that, this all looks good to me. I also tested that the docs |
On Wed, Feb 4, 2009 at 05:56, Eric Smith <report@bugs.python.org> wrote:
Does "... as a named tuple" make sense? -Brett |
"... as a named tuple" works for me. I'll go with that. Thanks! |
Technically it's not a named tuple. Calling it named tuple may cause |
+1 Remember, "named tuple" is a concept, not a class. It is anything that |
Committed in r69331 (trunk) and r69346 (py3k). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: