Skip to content

[MNT] aa_props() uses 'type' as parameter name, shadowing Python builtin #656

@onkar717

Description

@onkar717

Describe the bug

aa_props() in pyaptamer/pseaac/_props.py uses type as a parameter name, which shadows Python's builtin type() function. This makes it impossible to use type() for type checking inside the function body and can cause subtle bugs if the function is extended in the future.

To Reproduce

from pyaptamer.pseaac._props import aa_props
import inspect

sig = inspect.signature(aa_props)
print(sig)  # (prop_indices=None, type='numpy', normalize=True)
# 'type' shadows the builtin

Expected behavior

The parameter should be renamed to output_type (or return_type) to avoid shadowing the builtin, consistent with the naming convention used elsewhere in the codebase.

Additional context

  • This affects the function signature, docstring, and 3 call sites:
    • _pseaac_aptanet.py (line 104)
    • _pseaac_general.py (line 134)
    • test_pseaac.py (lines 20-21)
  • While not a runtime crash, shadowing builtins is flagged by linters (e.g., ruff A002) and is considered a code quality issue.

Versions

Details
pyaptamer 0.1.0a1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions