diff options
| author | Matt Trentini <matt.trentini@gmail.com> | 2022-08-19 01:15:50 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-08-26 15:09:06 +1000 |
| commit | 6b16ce8d38461e9a8f11642a4a9c6e4621c00872 (patch) | |
| tree | 93fc39c40ce033597efc2f0ad1d73311b3a41308 /docs/differences/python_39.rst | |
| parent | 2e386bcf76c38a81a9de93452f9a253c571d2b72 (diff) | |
docs: Update CPython differences and improve the look of table layouts.
Updated some of the CPython feature differences:
- Updated status of some features.
- Added CSS to fix table widths to 100% and word wrap.
- Specified explicit table column ratios to improve layout appearance.
- Added missing references to anchors.
- Better consistency with use of formatting and case.
Diffstat (limited to 'docs/differences/python_39.rst')
| -rw-r--r-- | docs/differences/python_39.rst | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/docs/differences/python_39.rst b/docs/differences/python_39.rst index 6852dd635..023c6d7c1 100644 --- a/docs/differences/python_39.rst +++ b/docs/differences/python_39.rst @@ -8,35 +8,41 @@ defined in `PEP 596 <https://www.python.org/dev/peps/pep-0596/#features-for-3-9> and a detailed description of the changes can be found in `What's New in Python 3.9 <https://docs.python.org/3/whatsnew/3.9.html>`_ +.. table:: + :widths: 20 60 20 + +--------------------------------------------------------+----------------------------------------------------+--------------+ - | **Features:** | | **Status** | + | **Features** | | **Status** | +--------------------------------------------------------+----------------------------------------------------+--------------+ - | `PEP 573 <https://www.python.org/dev/peps/pep-0573/>`_ | fast access to module state from methods of C | | + | `PEP 573 <https://www.python.org/dev/peps/pep-0573/>`_ | Fast access to module state from methods of C | | | | extension types | | +--------------------------------------------------------+----------------------------------------------------+--------------+ - | `PEP 584 <https://www.python.org/dev/peps/pep-0584/>`_ | union operators added to dict | | + | `PEP 584 <https://www.python.org/dev/peps/pep-0584/>`_ | Union operators added to dict | | +--------------------------------------------------------+----------------------------------------------------+--------------+ - | `PEP 585 <https://www.python.org/dev/peps/pep-0584/>`_ | type hinting generics in standard collections | | + | `PEP 585 <https://www.python.org/dev/peps/pep-0584/>`_ | Type hinting generics in standard collections | | +--------------------------------------------------------+----------------------------------------------------+--------------+ - | `PEP 593 <https://www.python.org/dev/peps/pep-0593/>`_ | flexible function and variable annotations | | + | `PEP 593 <https://www.python.org/dev/peps/pep-0593/>`_ | Flexible function and variable annotations | | +--------------------------------------------------------+----------------------------------------------------+--------------+ | `PEP 602 <https://www.python.org/dev/peps/pep-0602/>`_ | CPython adopts an annual release cycle. Instead of | | | | annual, aiming for two month release cycle | | +--------------------------------------------------------+----------------------------------------------------+--------------+ - | `PEP 614 <https://www.python.org/dev/peps/pep-0614/>`_ | relaxed grammar restrictions on decorators | | + | `PEP 614 <https://www.python.org/dev/peps/pep-0614/>`_ | Relaxed grammar restrictions on decorators | | +--------------------------------------------------------+----------------------------------------------------+--------------+ - | `PEP 615 <https://www.python.org/dev/peps/pep-0615/>`_ | the IANA Time Zone Database is now present in the | | + | `PEP 615 <https://www.python.org/dev/peps/pep-0615/>`_ | The IANA Time Zone Database is now present in the | | | | standard library in the zoneinfo module | | +--------------------------------------------------------+----------------------------------------------------+--------------+ - | `PEP 616 <https://www.python.org/dev/peps/pep-0616/>`_ | string methods to remove prefixes and suffixes | | + | `PEP 616 <https://www.python.org/dev/peps/pep-0616/>`_ | String methods to remove prefixes and suffixes | | +--------------------------------------------------------+----------------------------------------------------+--------------+ | `PEP 617 <https://www.python.org/dev/peps/pep-0617/>`_ | CPython now uses a new parser based on PEG | | +--------------------------------------------------------+----------------------------------------------------+--------------+ Other Language Changes: +.. table:: + :widths: 90 10 + +-------------------------------------------------------------------------------------------------------------+---------------+ - | *__import__()* now raises *ImportError* instead of *ValueError* | Completed | + | *__import__()* now raises *ImportError* instead of *ValueError* | Complete | +-------------------------------------------------------------------------------------------------------------+---------------+ | Python now gets the absolute path of the script filename specified on the command line (ex: *python3* | | | *script.py*): the *__file__* attribute of the *__main__* module became an absolute path, rather than a | | @@ -62,8 +68,11 @@ Other Language Changes: Changes to built-in modules: +.. table:: + :widths: 90 10 + +---------------------------------------------------------------------------------------------------------------+---------------+ - | `asyncio` | + | `asyncio <https://docs.python.org/3/whatsnew/3.9.html#asyncio>`_ | +---------------------------------------------------------------------------------------------------------------+---------------+ | Due to significant security concerns, the reuse_address parameter of *asyncio.loop.create_datagram_endpoint()*| | | is no longer supported | | @@ -82,13 +91,13 @@ Changes to built-in modules: +---------------------------------------------------------------------------------------------------------------+---------------+ | *asyncio* now raises *TyperError* when calling incompatible methods with an *ssl.SSLSocket* socket | | +---------------------------------------------------------------------------------------------------------------+---------------+ - | `gc` | + | `gc <https://docs.python.org/3/whatsnew/3.9.html#gc>`_ | +---------------------------------------------------------------------------------------------------------------+---------------+ | Garbage collection does not block on resurrected objects | | +---------------------------------------------------------------------------------------------------------------+---------------+ | Added a new function *gc.is_finalized()* to check if an object has been finalized by the garbage collector | | +---------------------------------------------------------------------------------------------------------------+---------------+ - | `math` | + | `math <https://docs.python.org/3/whatsnew/3.9.html#math>`_ | +---------------------------------------------------------------------------------------------------------------+---------------+ | Expanded the *math.gcd()* function to handle multiple arguments. Formerly, it only supported two arguments | | +---------------------------------------------------------------------------------------------------------------+---------------+ @@ -98,21 +107,21 @@ Changes to built-in modules: +---------------------------------------------------------------------------------------------------------------+---------------+ | Added *math.ulp()*: return the value of the least significant bit of a float | | +---------------------------------------------------------------------------------------------------------------+---------------+ - | `os` | + | `os <https://docs.python.org/3/whatsnew/3.9.html#os>`_ | +---------------------------------------------------------------------------------------------------------------+---------------+ | Exposed the Linux-specific *os.pidfd_open()* and *os.P_PIDFD* | | +---------------------------------------------------------------------------------------------------------------+---------------+ - | The *os.unsetenv()* function is now also available on Windows | Completed | + | The *os.unsetenv()* function is now also available on Windows | Complete | +---------------------------------------------------------------------------------------------------------------+---------------+ - | The *os.putenv()* and *os.unsetenv()* functions are now always available | Completed | + | The *os.putenv()* and *os.unsetenv()* functions are now always available | Complete | +---------------------------------------------------------------------------------------------------------------+---------------+ | Added *os.waitstatus_to_exitcode()* function: convert a wait status to an exit code | | +---------------------------------------------------------------------------------------------------------------+---------------+ - | `random` | + | `random <https://docs.python.org/3/whatsnew/3.9.html#random>`_ | +---------------------------------------------------------------------------------------------------------------+---------------+ | Added a new *random.Random.randbytes* method: generate random bytes | | +---------------------------------------------------------------------------------------------------------------+---------------+ - | `sys` | + | `sys <https://docs.python.org/3/whatsnew/3.9.html#sys>`_ | +---------------------------------------------------------------------------------------------------------------+---------------+ | Added a new *sys.platlibdir* attribute: name of the platform-specific library directory | | +---------------------------------------------------------------------------------------------------------------+---------------+ |
