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
Describe the bug
aa_props()inpyaptamer/pseaac/_props.pyusestypeas a parameter name, which shadows Python's builtintype()function. This makes it impossible to usetype()for type checking inside the function body and can cause subtle bugs if the function is extended in the future.To Reproduce
Expected behavior
The parameter should be renamed to
output_type(orreturn_type) to avoid shadowing the builtin, consistent with the naming convention used elsewhere in the codebase.Additional context
_pseaac_aptanet.py(line 104)_pseaac_general.py(line 134)test_pseaac.py(lines 20-21)ruff A002) and is considered a code quality issue.Versions
Details