◐ Shell
clean mode source ↗

Message 226659 - Python tracker

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.