Skip to content

Commit 0e461d1

Browse files
committed
Change _caller back to caller for nameof.
1 parent 0d5238c commit 0e461d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/test_varname.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
def nameof(*args):
1919
"""Test both implementations at the same time"""
20-
result = original_nameof(*args, _caller=2)
20+
result = original_nameof(*args, caller=2)
2121
if len(args) == 1:
2222
assert result == _bytecode_nameof(caller=2)
2323
return result

varname.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def inject(obj: any) -> any:
162162

163163
# _caller is only used for test purposes
164164
# or unless one wants to wrap this function
165-
def nameof(*args, _caller: int = 1) -> Union[str, Tuple[str]]:
165+
def nameof(*args, caller: int = 1) -> Union[str, Tuple[str]]:
166166
"""Get the names of the variables passed in
167167
168168
Examples:
@@ -180,10 +180,10 @@ def nameof(*args, _caller: int = 1) -> Union[str, Tuple[str]]:
180180
Returns:
181181
tuple|str: The names of variables passed in
182182
"""
183-
node = _get_node(_caller - 1)
183+
node = _get_node(caller - 1)
184184
if not node:
185185
if len(args) == 1:
186-
return _bytecode_nameof(_caller + 1)
186+
return _bytecode_nameof(caller + 1)
187187
raise VarnameRetrievingError("Unable to retrieve callee's node.")
188188

189189
ret = []

0 commit comments

Comments
 (0)