Skip to content

The Inline Method refactoring does not inline all the attributes #827

Open

Description

@jonh-copin

The Inline Method refactoring does not inline all the attributes, causing 'NameError'

Steps to reproduce the behavior:

  1. 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()
  1. Apply the inline method to register()

  2. 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()

Activity

  1. added
    bugUnexpected or incorrect user-visible behavior
    on Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected or incorrect user-visible behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions