Ticket #6297 task closed fixed

Opened 15 months ago

Last modified 14 months ago

Remove usage of twisted.python.compat.set and frozenset

Reported by: thijs Owned by: tom.prince
Priority: low Milestone:
Component: core Keywords: easy
Cc: thijs Branch: branches/remove-set-frozenset-6297
(diff, github, buildbot, log)
Author: tomprince Launchpad Bug:

Description (last modified by thijs) (diff)

set and frozenset builtins were introduced in python2.4 and the sets module deprecated since python2.6. This makes compat.set and compat.frozenset redundant and the following imports can be removed:

./twisted/trial/runner.py:26:from twisted.python.compat import set
./twisted/trial/reporter.py:21:from twisted.python.compat import set
./twisted/trial/test/test_script.py:13:from twisted.python.compat import set
./twisted/scripts/trial.py:15:from twisted.python.compat import set
./twisted/mail/relaymanager.py:33:from twisted.python.compat import set
./twisted/mail/maildir.py:21:from twisted.python.compat import set
./twisted/web/_newclient.py:36:from twisted.python.compat import set
./twisted/web/test/test_wsgi.py:17:from twisted.python.compat import set
./twisted/web/test/test_static.py:13:from twisted.python.compat import set
./twisted/web/client.py:39:from twisted.python.compat import set
./twisted/protocols/amp.py:185:from twisted.python.compat import set
./twisted/names/test/test_client.py:12:from twisted.python.compat import set
./twisted/python/test/test_zipstream.py:12:from twisted.python.compat import set
./twisted/python/test/test_fakepwd.py:23:from twisted.python.compat import set
./twisted/internet/posixbase.py:18:from twisted.python.compat import set, _PY3
./twisted/internet/base.py:20:from twisted.python.compat import set
./twisted/internet/_glibbase.py:23:from twisted.python.compat import set
./twisted/internet/test/test_posixbase.py:10:from twisted.python.compat import set, _PY3
./twisted/internet/test/test_process.py:14:from twisted.python.compat import set
./twisted/internet/iocpreactor/reactor.py:35:from twisted.python.compat import set
./twisted/conch/test/test_openssh_compat.py:12:from twisted.python.compat import set
./twisted/conch/test/test_tap.py:27:from twisted.python.compat import set
./twisted/test/test_compat.py:15:from twisted.python.compat import set, frozenset, reduce, execfile, _PY3
./twisted/test/test_process.py:31:from twisted.python.compat import set
./twisted/test/test_paths.py:14:from twisted.python.compat import set, _PY3
./twisted/test/test_task.py:10:from twisted.python.compat import set
./twisted/words/protocols/irc.py:44:from twisted.python.compat import set

The compat versions could also be deprecated if deemed necessary.

Attachments

kevinwo-6297.patch Download (12.8 KB) - added by kevinwo 14 months ago.
remove-set-frozenset-kevinwo-6297-1.patch Download (17.3 KB) - added by kevinwo 14 months ago.

Change History

1

Changed 15 months ago by thijs

  • description modified (diff)

2

Changed 14 months ago by Julian

  • keywords easy added

3

Changed 14 months ago by kevinwo

  • owner set to kevinwo
  • status changed from new to assigned

Changed 14 months ago by kevinwo

4

Changed 14 months ago by kevinwo

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

All traces of 'set' and 'frozenset' have been removed

5

Changed 14 months ago by tom.prince

  • owner set to tom.prince

6

Changed 14 months ago by tom.prince

  • keywords review removed
  • owner changed from tom.prince to kevinwo

Thanks for your contribution.

There are a couple of more uses:

twisted/web/test/test_http_headers.py twisted/web/test/test_http.py twisted/python/test/test_release.py

Also, you need to add news files (.misc probably) to each touched component.

Please resubmit for review after removing the remaining uses and adding a topfile.

Changed 14 months ago by kevinwo

7

Changed 14 months ago by kevinwo

  • keywords review added
  • owner changed from kevinwo to tom.prince

Thanks, Tom. I've attached an updated patch handling the uses you mentioned along with topfiles.

8

Changed 14 months ago by tomprince

  • branch set to branches/remove-set-frozenset-6297
  • branch_author set to tomprince

(In [37414]) Branching to remove-set-frozenset-6297.

9

Changed 14 months ago by tom.prince

  • keywords review removed

 build results

Just a note: .misc topfiles don't need (and ignore) conetent. And for the rest of the topfiles, they should contain something appropriate to go in the NEWS files and they get rewrapped. For this particular change, since there is no user visibile change, the misc file just causes the ticket to appear under "Other".

I'll merge.

10

Changed 14 months ago by tomprince

  • status changed from new to closed
  • resolution set to fixed

(In [37416]) Merge remove-set-frozenset-6297: Remove usage of twisted.python.compat.set and frozenset.

Author: kevinwo Reviewers: therve Fixes: #6297

set and frozenset builtins were introduced in python2.4 and the sets module deprecated since python2.6. This makes compat.set and compat.frozenset redundant.

Note: See TracTickets for help on using tickets.