[issue3316] Proposal for fix_urllib

Collin Winter report at bugs.python.org
Thu Jul 10 19:42:35 CEST 2008


Collin Winter <collinw at gmail.com> added the comment:

- You should add tests to test_fixers to ensure that this does what you
expect. This will make it much easier for others to modify this fixer
later. You can probably just reuse the tests Brett initially added.

- There's a better data structure for MAPPING: rather than using

MAPPING = {module: [(new_module, [member, member, ..., member])]}

you should probably use

MAPPING = {module: {new_module: [member, member, ..., member]}}

The list-of-2-tuples was a bad idea on my part that didn't scale.

- The "cannot handle star imports" warning isn't strictly correct: star
imports for robotparser and urlparse can both be handled correctly,
since they're just being renamed.

- urlparse and robotparser don't seem to belong to this more specialized
fixer: they can go in fix_imports, since they aren't being broken across
multiple modules.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3316>
_______________________________________


More information about the Python-bugs-list mailing list