Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Field refactoring allows the use of a name that can not be iterable #764

Closed
Tracked by #779
researcher175 opened this issue Feb 27, 2024 · 1 comment
Closed
Tracked by #779

Comments

@researcher175
Copy link

Rename field refactoring allows the use of post-declared methods as new names for the field.
It would be nice if Rope could emit an alert to the users indicating the probable problems that could be generated if the operation continues.
Python's name resolution can cause type errors during execution.

Steps to reproduce the behavior:

  1. Code before refactoring:
MIN_CORPORA = ['brown']
ADDITIONAL_CORPORA = ['movie_reviews']
ALL_CORPORA = MIN_CORPORA + ADDITIONAL_CORPORA

def download(param):
    pass

def download_lite():
    for each in MIN_CORPORA:
        download(each)

def download_all():
    for each in ALL_CORPORA:
        download(each)


def main():
    download_lite()
    download_all()


main()
  1. Apply the Rename Field refactoring with the new name 'download_all' to the field 'MIN_CORPORA'
@researcher175 researcher175 added the bug Unexpected or incorrect user-visible behavior label Feb 27, 2024
@lieryan
Copy link
Member

lieryan commented Mar 12, 2024

Closing. Ticket merged into #779.

@lieryan lieryan closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2024
@lieryan lieryan added enhancement and removed bug Unexpected or incorrect user-visible behavior labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants