mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Fix dataclass comment typo _eq__ -> __eq__ (GH-26433) (GH-26436)
(cherry picked from commit 7e6f237569
)
Co-authored-by: Sean Grady <vedicmonk@gmail.com>
Co-authored-by: Sean Grady <vedicmonk@gmail.com>
This commit is contained in:
parent
a7aa105702
commit
1757ddd227
1 changed files with 1 additions and 1 deletions
|
@ -1038,7 +1038,7 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
|
||||||
_set_new_attribute(cls, '__repr__', _repr_fn(flds, globals))
|
_set_new_attribute(cls, '__repr__', _repr_fn(flds, globals))
|
||||||
|
|
||||||
if eq:
|
if eq:
|
||||||
# Create _eq__ method. There's no need for a __ne__ method,
|
# Create __eq__ method. There's no need for a __ne__ method,
|
||||||
# since python will call __eq__ and negate it.
|
# since python will call __eq__ and negate it.
|
||||||
flds = [f for f in field_list if f.compare]
|
flds = [f for f in field_list if f.compare]
|
||||||
self_tuple = _tuple_str('self', flds)
|
self_tuple = _tuple_str('self', flds)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue