python-rope / rope

a python refactoring library
GNU Lesser General Public License v3.0
1.93k stars 162 forks source link

Rename Field refactoring allows you to rename a field with the same name used in a global method #761

Closed researcher175 closed 6 months ago

researcher175 commented 7 months ago

Rename Field refactoring allows you to rename a field with the same name used in a global method It would be nice if Rope could alert the user to decide whether to continue or not with the transformation.

Steps to reproduce the behavior:

  1. Code before refactoring:
    
    import csv

DEFAULT_ENCODING = 'utf-8'

class DelimitedFormat(object): def init(self, fp, **kwargs): reader = csv.reader(fp, delimiter=",", encoding=DEFAULT_ENCODING)

def detect(fp, max_read=1024): return None



2. Apply the Rename Field refactoring to 'DEFAULT_ENCODING' with the new name 'detect'
lieryan commented 6 months ago

Closing. Ticket merged into #779.