Ticket #4301 enhancement new

Opened 4 years ago

Last modified 3 years ago

defer.py: Remove py3k deprecation warnngs when running twisted/test

Reported by: drtimcouper Owned by: drtimcouper
Priority: normal Milestone: Python-3.x
Component: core Keywords:
Cc: thijs Branch:
Author: Launchpad Bug:

Description (last modified by thijs) (diff)

To demonstrate success:

  1. Run trial twisted/test and save the deprecation warnings in a file (so that's 2>1)
  2. Apply the patch
  3. Run trial twisted/test again to another file, and diff the two.

There should be no defer.py references in the second file which refer to py3k deprecations

Attachments

3k-internet-defer-4301.patch Download (0.6 KB) - added by drtimcouper 4 years ago.
3k-internet-defer-4301.2.patch Download (1.6 KB) - added by drtimcouper 4 years ago.
version 2 with a missed deprecation included

Change History

Changed 4 years ago by drtimcouper

1

Changed 4 years ago by drtimcouper

  • status changed from new to assigned

2

Changed 4 years ago by drtimcouper

  • status changed from assigned to new
  • keywords review added
  • owner drtimcouper deleted

3

Changed 4 years ago by drtimcouper

  • keywords review removed

Changed 4 years ago by drtimcouper

version 2 with a missed deprecation included

4

Changed 4 years ago by drtimcouper

  • keywords review added

5

Changed 4 years ago by exarkun

  • keywords review removed
  • owner set to drtimcouper
  1. See #4065 for the discussion about how to deal with callable
  2. Converting to __eq__ from __cmp__ shouldn't throw away the nice docstring about how comparison is defined.
  3. __cmp__ gives us == and !-, so I think we need __ne__ as well. It might make sense to use twisted.python.util.FancyEqMixin.
  4. Adding __hash__ to fix the 3k warning is good, but it looks like that behavior is also untested. We should add tests for the behavior, and we should probably also implement hashability so that it makes sense related to the comparison implementation.

Thanks!

6

Changed 4 years ago by thijs

  • cc thijs added
  • milestone set to Python-3.x

7

Changed 4 years ago by exarkun

  • summary changed from defer.py: Remove py3k deprecation warnngs when running twistedl/test to defer.py: Remove py3k deprecation warnngs when running twisted/test

8

Changed 3 years ago by thijs

  • description modified (diff)
Note: See TracTickets for help on using tickets.