This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author superluser
Recipients Anthony.Kong, BreamoreBoy, benjamin.peterson, ezio.melotti, meador.inge, superluser
Date 2014-09-09.20:52:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1410295959.6.0.502478960614.issue13272@psf.upfronthosting.co.za>
In-reply-to
Content
Changing the imports only is straightforward, but I'm having trouble detecting and changing future uses of the variables, without also clobbering user-defined variables with the same names.

I notice some of the current fixers have similar problems, for example the itertools fixer changes:


```
def imap(): pass
imap()
```

to
 

```
def imap(): pass
map()
```

This patch is a little smarter than that, but it only detects top-level definitions.  For example, the lowercase in 


```
class Foo:
  def __init__(self):
    self.lowercase = "blargh"
```

still gets renamed.

I can work on this more, but would like to know:

a) whether this fix is still wanted
b) how smart it needs to be
c) whether my approach is reasonable.  I feel like there should be an easier way.
History
Date User Action Args
2014-09-09 20:52:39superlusersetrecipients: + superluser, benjamin.peterson, ezio.melotti, meador.inge, BreamoreBoy, Anthony.Kong
2014-09-09 20:52:39superlusersetmessageid: <1410295959.6.0.502478960614.issue13272@psf.upfronthosting.co.za>
2014-09-09 20:52:39superluserlinkissue13272 messages
2014-09-09 20:52:39superlusercreate