Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace use of attrs cmp with eq and order in twisted.internet.address.UNIXAddress #9710

Closed
twisted-trac opened this issue Oct 8, 2019 · 6 comments

Comments

@twisted-trac
Copy link

twm's avatar @twm reported
Trac ID trac#9710
Type enhancement
Created 2019-10-08 00:39:50Z
Branch https://github.com/twisted/twisted/tree/attrs-cmp-deprecated-9710

attrs 19.2.0 deprecated cmp and now issues deprecation warnings like this:

twisted/internet/address.py:101: DeprecationWarning: The usage of `cmp` is deprecated and will be removed on or after 2021-06-01.  Please use `eq` and `order` instead.

See also glyph/automat#117

Searchable metadata
trac-id__9710 9710
type__enhancement enhancement
reporter__twm twm
priority__normal normal
milestone__None None
branch__attrs_cmp_deprecated_9710 attrs-cmp-deprecated-9710
branch_author__ 
status__closed closed
resolution__fixed fixed
component__core core
keywords__easy easy
time__1570495190251241 1570495190251241
changetime__1576460961383431 1576460961383431
version__None None
owner__twm twm

@twisted-trac
Copy link
Author

Julian's avatar @Julian commented

twisted.internet.address.UNIXAddress seems like the only class in the code base that actually uses attrs this way to me, so narrowing the scope of this ticket, but if I missed one let me know.

ISTM too that it might be nice to include "deprecate ordering those objects" too -- not sure how sensical / intentional making UNIXAddress sortable is/was. It sorts by filename, which doesn't seem terribly useful.

@twisted-trac
Copy link
Author

twm's avatar @twm commented

cmp=False is equivalent to eq=False and ord=False. UNIXAddress seems to only implement __eq__ and __ne__ i.e. eq=True, so it's not orderable unless I miss something.

@twisted-trac
Copy link
Author

twm's avatar @twm set owner to @twm
@twm set status to assigned

@twisted-trac
Copy link
Author

twm's avatar @twm removed owner
@twm set status to new

#1199

@twisted-trac
Copy link
Author

moshez's avatar @moshez set owner to @twm

reviewed on GH

@twisted-trac
Copy link
Author

twm's avatar @twm set status to closed

In changeset b4a0d27

#!CommitTicketReference repository="" revision="b4a0d271e0b64a928f21ef7dc3c309234d840d45"
Merge pull request #1199 from twisted/attrs-cmp-deprecated-9710

Author: twm
Reviewer: mozhez
Fixes: ticket:9710

Depend on attrs ≥19.2.0; use eq instead of cmp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants