Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion mypy/plugins/attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ def _determine_eq_order(ctx: 'mypy.plugin.ClassDefContext') -> Tuple[bool, bool]

# cmp takes precedence due to bw-compatibility.
if cmp is not None:
ctx.api.fail("cmp is deprecated, use eq and order", ctx.reason)
return cmp, cmp

# If left None, equality is on and ordering mirrors equality.
Expand Down
6 changes: 3 additions & 3 deletions test-data/unit/check-attr.test
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,15 @@ A(1) != 1

[case testAttrsCmpEqOrderValues]
from attr import attrib, attrs
@attrs(cmp=True) # E: cmp is deprecated, use eq and order
@attrs(cmp=True)
class DeprecatedTrue:
...

@attrs(cmp=False) # E: cmp is deprecated, use eq and order
@attrs(cmp=False)
class DeprecatedFalse:
...

@attrs(cmp=False, eq=True) # E: Don't mix `cmp` with `eq' and `order` # E: cmp is deprecated, use eq and order
@attrs(cmp=False, eq=True) # E: Don't mix `cmp` with `eq' and `order`
Copy link
Member

@ilevkivskyi ilevkivskyi Oct 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed the old-school quotes here :-) I mean `...' is great, but we are now moving towards unifying all error messages on using plain boring double quotes. So it would be great to update this (possibly in a separate PR).

class Mixed:
...

Expand Down