Skip to content

chore: normalize stdlib copy imports to import copy#1509

Open
dimitri-yatsenko wants to merge 1 commit into
masterfrom
chore/normalize-copy-imports
Open

chore: normalize stdlib copy imports to import copy#1509
dimitri-yatsenko wants to merge 1 commit into
masterfrom
chore/normalize-copy-imports

Conversation

@dimitri-yatsenko

Copy link
Copy Markdown
Member

Standardizes how the stdlib copy module is imported across the codebase. Three modules used three conventions:

  • diagram.pyimport copy as copy_moduleimport copy (the alias was unnecessary; copy only appears there as a keyword argument, which can't collide with the module name)
  • settings.pyfrom copy import deepcopyimport copy, call-sites qualified as copy.deepcopy
  • expression.py — already import copy (uses copy.copy); unchanged

Now uniform: import copy with qualified copy.deepcopy / copy.copy, so one import covers both shallow and deep copies. Pure rename — no behavior change (identifiers only; ruff/isort/mypy clean, imports verified). Split out of #1508.

Three modules used three conventions for the copy module: diagram.py
`import copy as copy_module`, settings.py `from copy import deepcopy`,
expression.py `import copy`. Standardize on plain `import copy` with qualified
`copy.deepcopy` / `copy.copy` — one import covers both shallow and deep copies,
and the diagram.py alias was unnecessary (`copy` there only appears as a keyword
argument, which can't collide with the module name). No behavior change.
@dimitri-yatsenko dimitri-yatsenko added this to the v2.3.2 milestone Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant