In Python 3:
* various builtins and dict methods were changed to return
view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
removed altogether
This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).
Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.
issue #8530
Demoted to library in Python 3, see if uses can be replaced by more
specific construct, just import functools.reduce otherwise.
Futurize fixers:
* lib2to3.fixes.fix_reduce
For readability and coherence, in Python 3 the prefix for octal
literal becomes ``0o`` (rather than just ``0``). This new version was
also added to Python 2 as of 2.6.
Convert all octal literals in file-manipulation code (POSIX ACL), and
fix a few integers which were unwittingly octal.
(lib2to3.fixes.fix_numliterals)
Redundant with `in` and removed from Python 3.
Removed odd, old and long-unused UpdatableDict (which defines and uses
has_key) and UpdatableStr (which was nearby and caught in the blast),
validated with al.
(lib2to3.fixes.fix_has_key)
* `<>` was removed and should be replaced by
`!=` (lib2to3.fixes.fix_ne)
* `\`` was removed and should be replaced by either `repr()` or the
`%r` format string modifier (lib2to3.fixes.fix_repr followed by
hand-rolled edition to replace concatenation)