Rose Ames added the comment:

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.

----------
keywords: +patch
nosy: +superluser
Added file: http://bugs.python.org/file36586/string_partial.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13272>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to