rope
rope copied to clipboard
The Inline Method refactoring does not inline all the attributes
The Inline Method refactoring does not inline all the attributes, causing 'NameError'
Steps to reproduce the behavior:
- Code before refactoring:
_registry = {}
def get_registry():
return _registry
def register(name, format_class):
get_registry()[name] = format_class
def usa_register():
print("antes:", get_registry())
register("redis", "MockRedisFormat")
print("depois:", get_registry())
usa_register()
-
Apply the inline method to
StringlikeMixin.find -
Code after refactoring:
_registry = {}
def get_registry():
return _registry
def usa_register():
print("antes:", get_registry())
get_registry()[name] = "MockRedisFormat"
print("depois:", get_registry())
usa_register()