Replace deprecated functions from string module
These methods have been deprecated since at least Python 2.4 and their
replacements are available since at least that version.
Individual changes:
* Replace string.atoi() by int()
* Replace string.split() by str.split()
* Replace string.join() by sep.join()
* Replace string.strip() by str.strip()
* Replace string.replace() by str.replace()
* Drop now unused 'import string'
These are the individual commits, you can apply them by passing all files to
git-am
(or the whole directory, if there are no other patches).Diff:
Passes make, make check and a full make doc
Patch on countdown for Oct 23rd
Patch counted down - please push
I’m very late to the review party and don’t know much about python but maybe you (Jonas) could look at my questions on Rietveld before pushing?
Last edit: Malte Meyn 2019-10-23
Do my answers make sense, can I go forward with pushing? If you have more questions, please let me know.
Yes, they do. Consistency of '' and "" with the surrounding code makes sense (maybe it would be nice to be consistent in the whole file/project, but that’s another question and would probably need a large number of changes for little benefit). I didn’t know that they are basically the same.
Yeah, eventually a cleanup of those would be nice, and also a global policy on whether there is a space before a function call or not. But I wouldn't want to tackle this until we have migrated to Python 3, which will be difficult enough without a global reformatting...
Patch counted down - please push