Propagate int-max-str-digits ValueError#1155
Conversation
8476666 to
4378118
Compare
4378118 to
ae1a810
Compare
| @@ -405,7 +405,13 @@ def __init__(self, version: str) -> None: | |||
| try: | |||
| self._release = tuple(map(int, version.split("."))) | |||
There was a problem hiding this comment.
We could keep version.split’s result and use that instead of splitting again.
There was a problem hiding this comment.
I tried that and it causes a minor slow down of simple version construction.
There was a problem hiding this comment.
Interesting, do you know why? Is it because it keeps around the reference for a bit longer?
There was a problem hiding this comment.
I can only speculate here, but yeah, it seems like storing a value and then accessing it has a measurable performance impact at the level of optimization we're at now.
There was a problem hiding this comment.
It still gets stored, though - the only difference should be that the ref lives longer (and gets bumped one more pair of times, probably). Unless it can reduce this (not impossible, but unlikely - numpy can do this sort of thing on unix but not windows).
I wonder if del'ing the variable afterwords would affect it.
Fixes #1154
Let the CPython int-max-str-digits
ValueErrorpropagate fromVersion()instead of converting it toInvalidVersion.