Change the default for order to be False.

See https://github.com/ericvsmith/dataclasses/issues/104 for discussion.
This commit is contained in:
Eric V. Smith 2017-12-02 08:55:08 -05:00
parent dba3334a07
commit 5aea6ec4ac
1 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ Type: Standards Track
Content-Type: text/x-rst
Created: 02-Jun-2017
Python-Version: 3.7
Post-History: 08-Sep-2017, 25-Nov-2017, 30-Nov-2017, 01-Dec-2017
Post-History: 08-Sep-2017, 25-Nov-2017, 30-Nov-2017, 01-Dec-2017, 02-Dec-2017
Notice for Reviewers
====================
@ -166,7 +166,7 @@ The ``dataclass`` decorator is typically used with no parameters and
no parentheses. However, it also supports the following logical
signature::
def dataclass(*, init=True, repr=True, eq=True, order=True, hash=None, frozen=False)
def dataclass(*, init=True, repr=True, eq=True, order=False, hash=None, frozen=False)
If ``dataclass`` is used just as a simple decorator with no
parameters, it acts as if it has the default values documented in this
@ -180,7 +180,7 @@ signature. That is, these three uses of ``@dataclass`` are equivalent::
class C:
...
@dataclass(init=True, repr=True, eq=True, order=True, hash=None, frozen=False)
@dataclass(init=True, repr=True, eq=True, order=False, hash=None, frozen=False)
class C:
...
@ -201,7 +201,7 @@ The parameters to ``dataclass`` are:
its fields, in order. Both instances in the comparison must be of
the identical type.
- ``order``: If true (the default), ``__lt__``, ``__le__``,
- ``order``: If true (the default is False), ``__lt__``, ``__le__``,
``__gt__``, and ``__ge__`` methods will be generated. These compare
the class as if it were a tuple of its fields, in order. Both
instances in the comparison must be of the identical type. If