Skip to content

Commit

Permalink
#22 | cannot do full len of name, otherwise it will trample the origi…
Browse files Browse the repository at this point in the history
…nal method
  • Loading branch information
mxndtaylor committed Jun 10, 2024
1 parent a6eac17 commit 49ad394
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "aliasing"
version = "0.5.3"
version = "0.5.4"
description = "A utility for duplicating class members to other names or \"aliases\""
authors = [
{ name = "mxt", email = "[email protected]" },
Expand Down
3 changes: 2 additions & 1 deletion src/aliasing/virtual_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(
)

def __set_name__(self, owner: Any, name: str) -> None:
print(owner, name)
super().__set_name__(owner, name)
is_warn = is_err = False
msg = ""
Expand Down Expand Up @@ -105,7 +106,7 @@ def _generate_substring(cls, name: str, *, indices: list[int], strip_underscores
if strip_underscores and len(name) > 1:
name = name.lstrip('_')

for i in range(1, len(name) + 1):
for i in range(1, len(name)):
if i in indices:
results.append(name[:i])

Expand Down

0 comments on commit 49ad394

Please sign in to comment.