Parsing strings with whitespace to integers changed from Python2 to Python3.
In Python2 it is:
>>> int('-11')
-11
>>> int('- 11')
-11
whereas in Python3:
>>> int('-11')
-11
>>> int('- 11')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '- 11'
Once I figured this out, I tried to find some explanations for/elaborations on this change in the docs, but couldn't find anything.
So my questions are: How to modify code to migrate from py2 to py3? Is i = int(s.replace(' ',''))
the way to go? Or is there better advice? And is there some description of that change I just didn't find?