diff options
author | Anson Mansfield <amansfield@mantaro.com> | 2025-07-21 08:33:17 -0400 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-07-29 09:44:26 +1000 |
commit | d5dc5547427ef171e3ede4f8ac35ea9bf6f53fca (patch) | |
tree | 7fa889a173c21db818a77f9ff22de49e56e1e30f | |
parent | 4412753f0cf46fb28093a90d58988f541a531df4 (diff) |
docs: Document PEP487 __set_name__ implementation.
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
-rw-r--r-- | docs/differences/python_36.rst | 7 | ||||
-rw-r--r-- | py/mpconfig.h | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/docs/differences/python_36.rst b/docs/differences/python_36.rst index 3315b0594..18da79f8f 100644 --- a/docs/differences/python_36.rst +++ b/docs/differences/python_36.rst @@ -25,7 +25,8 @@ Python 3.6 beta 1 was released on 12 Sep 2016, and a summary of the new features +--------------------------------------------------------+--------------------------------------------------+-----------------+ | `PEP 468 <https://www.python.org/dev/peps/pep-0468/>`_ | Preserving the order of *kwargs* in a function | | +--------------------------------------------------------+--------------------------------------------------+-----------------+ - | `PEP 487 <https://www.python.org/dev/peps/pep-0487/>`_ | Simpler customization of class creation | | + | `PEP 487 <https://www.python.org/dev/peps/pep-0487/>`_ | Simpler customization of class creation | Partial | + | | | [#setname]_ | +--------------------------------------------------------+--------------------------------------------------+-----------------+ | `PEP 520 <https://www.python.org/dev/peps/pep-0520/>`_ | Preserving Class Attribute Definition Order | | +--------------------------------------------------------+--------------------------------------------------+-----------------+ @@ -198,3 +199,7 @@ Changes to built-in modules: +--------------------------------------------------------------------------------------------------------------+----------------+ | The *compress()* and *decompress()* functions now accept keyword arguments | | +--------------------------------------------------------------------------------------------------------------+----------------+ + +.. rubric:: Notes + +.. [#setname] Currently, only :func:`__set_name__` is implemented. diff --git a/py/mpconfig.h b/py/mpconfig.h index 619bce2ab..6ef6ec52e 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1129,7 +1129,7 @@ typedef time_t mp_timestamp_t; #define MICROPY_PY_FUNCTION_ATTRS_CODE (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_FULL_FEATURES) #endif -// Whether to support the descriptors __get__, __set__, __delete__ +// Whether to support the descriptors __get__, __set__, __delete__, __set_name__ // This costs some code size and makes load/store/delete of instance // attributes slower for the classes that use this feature #ifndef MICROPY_PY_DESCRIPTORS |