Closed
Description
Describe the bug
The /
syntax in parameter defines a positional-only argument:
def foo(a, /, arg):
Currently, rope doesn't handle variable scope around positional-only argument correctly.
To Reproduce
Steps to reproduce the behavior:
- Code before refactoring:
def foo(a, /, arg):
print(a)
-
Describe the refactoring you want to do: Extract refactoring
-
Expected code after refactoring:
def foo(a, /, arg):
extracted_method(a)
def extracted_method(a):
print(a)
- Describe the error or unexpected result that you are getting
def foo(a, /, arg):
extracted_method()
def extracted_method():
print(a)
Editor information (please complete the following information):
- Project Python version: 3.10
- Rope Python version: 3.10
- Rope version: 1.5.1
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
[-]Extract method passes incorrect keyword-only arguments around positional-only parameter[/-][+]Extract method doesn't correctly pass keyword-only arguments around positional-only parameter[/+][-]Extract method doesn't correctly pass keyword-only arguments around positional-only parameter[/-][+]Extract method doesn't correctly pass positional-only arguments correctly[/+]Fix #567. Add posonlyargs to list of written arguments when extracting