9

When I tried to rename myset in the following code, I saw the following message.

class NumberGenerator:
    def __init__(self):
        self.__myset__ = set()

    def uncount(self, i):
        self.__myset__.add(i)

Refactor failed. module 'rope.base.ast' has no attribute 'Str'
[<FrameSummary file refactor.py, line 294 in watch>, <FrameSummary file refactor.py, line 274 in _process_request>, <FrameSummary file refactor.py, line 206 in _rename>, ...

It's so long, if you want to see I can show you. Is this code wrong? It works, though. Why does refactor not work?

0

1 Answer 1

23

It doesn't work because Rope has some bugs in it. If you install Pylance then you may have better success (it will automatically prompt you to update your settings appropriately).

Sign up to request clarification or add additional context in comments.

8 Comments

Thank you for your answer!! I sure that by you.
I switched to Microsoft, but it doesn't have resymbol function anymore.
@BrettCannon Do you know what the difference between the python package developed by Microsoft and the one you mentioned in the last comment? They all developed by Microsoft.
@UniSize the link/Pylance is the new one, MPLS is the old one. I find Pylance faster and more accurate, so I would advise switching to it.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.