Add note about non-PEP 8 compliant function names.

This commit is contained in:
Eric V. Smith 2017-12-04 05:37:26 -05:00
parent 57ccf32901
commit 6b32e0d8ae
1 changed files with 13 additions and 0 deletions

View File

@ -752,6 +752,16 @@ through ``__init__`` (unless you suppress its creation). Which
approach is more appropriate will be application-specific, but both
approaches are supported.
asdict and astuple function names
---------------------------------
The names of the module-level helper functions ``asdict()`` and
``astuple()`` are arguably not PEP 8 compliant, and should be
``as_dict()`` and ``as_tuple()``, respectively. However, after
discussion [#]_ it was decided to keep consistency with
``namedtuple._asdict()`` and ``attr.asdict()``.
Rejected ideas
==============
@ -918,6 +928,9 @@ References
.. [#] why not just attrs?
(https://github.com/ericvsmith/dataclasses/issues/19)
.. [#] PEP 8 names for asdict and astuple
(https://github.com/ericvsmith/dataclasses/issues/110)
.. [#] Copying mutable defaults
(https://github.com/ericvsmith/dataclasses/issues/3)