Unified codebase for Python 2&3
|Reported by:||Foxboron||Owned by:||atagar|
|Severity:||Keywords:||python, 3, 2, unified, codebase|
This basically unifies the codebase and removes the need for a tool like 2to3.
The most instrusive change is the need for having a unified understanding of long/int/str/bytes/unicode across version.
Python 2.7 understands bytes to be str, so this will be consistent, but unicode is undefined on Python3.
So _compat.py solves this by defining long to be int, and unicode to be str on python3. This so far solves the problem in a nice way. But needs to be kept tidy when writing new code that relies on string types. Currently you can refer to bytes to be bytes, but have to import from _compat unicode if you want to refer to unicode, as references to "str" is unique to the python version.
This can be made easier to refer to a unified variable, but that could be further discussed.
This will most likely break 2.6 support, but i can work on adding that if thats actually needed.
Change History (9)
comment:6 Changed 2 years ago by atagar
- Resolution set to implemented
- Status changed from new to closed