<commit_before>:orphan:

==================================
Python 3 compatibility/conversions
==================================

Goal (notsure?): for v11 to provide an alpha/beta Python 3 compatibility, for
v12 to provide official Python 3 support and drop Python 2 in either v12 or
v13.

Python 2 and Python 3 are somewhat different language, but following
backports, forward ports and cross-compatibility library it is possible to
use a subset of Python 2 and Python 3 in order to have a system compatible
with both.

Here are a few useful steps or reminders to make Python 2 code compatible
with Python 3.

.. important::

    This is not a general-purpose guide for porting Python 2 to Python 3, it's
    a guide to write 2/3-compatible Odoo code. It does not go through all the
    changes in Python but rather through issues which have been found in the
    standard Odoo distribution in order to show how to evolve such code such
    that it works on both Python 2 and Python 3.

References/useful documents:
<commit_msg>[IMP] doc: update P3 compatibility policy<commit_after>:orphan:

==================================
Python 3 compatibility/conversions
==================================

Official compatibility: Odoo 11 will be the first LTS release to introduce
Python 3 compatibility, starting with Python 3.5. It will also be the first
LTS release to drop official support for Python 2.

Rationale: Python 3 has been around since 2008, and all Python libraries
used by the official Odoo distribution have been ported and are considered
stable. Most supported platforms have a Python 3.5 package, or a similar
way to deploy it. Preserving dual compatibility is therefore considered
unnecessary, and would represent a significant overhead in testing for the
lifetime of Odoo 11.

Python 2 and Python 3 are somewhat different language, but following
backports, forward ports and cross-compatibility library it is possible to
use a subset of Python 2 and Python 3 in order to have a system compatible
with both.

Here are a few useful steps or reminders to make Python 2 code compatible
with Python 3.

.. important::

    This is not a general-purpose guide for porting Python 2 to Python 3, it's
    a guide to write 2/3-compatible Odoo code. It does not go through all the
    changes in Python but rather through issues which have been found in the
    standard Odoo distribution in order to show how to evolve such code such
    that it works on both Python 2 and Python 3.

References/useful documents:

{'fraction_non_alphanumeric': 0.08211027370091234, 'fraction_numerical': 0.021023403411344704, 'mean_word_length': 4.287211740041928, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7610252', 'n_tokens_mistral': 656, 'n_tokens_neox': 586, 'n_words': 382}