You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm trying to use this package on Python 3.9.7 (very recent I know) and the sample code throws errors. Here are the results:
>>> xxxxx = varname()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/.local/lib/python3.9/site-packages/varname/core.py", line 103, in varname
refnode = get_node(frame + 1, ignore, raise_exc=raise_exc)
File "/home/ubuntu/.local/lib/python3.9/site-packages/varname/utils.py", line 127, in get_node
return get_node_by_frame(frameobj, raise_exc)
File "/home/ubuntu/.local/lib/python3.9/site-packages/varname/utils.py", line 132, in get_node_by_frame
exect = Source.executing(frame)
File "/home/ubuntu/.local/lib/python3.9/site-packages/executing/executing.py", line 309, in executing
lineno = frame.f_lineno
AttributeError: 'NoneType' object has no attribute 'f_lineno'
Then I also tried the following and got a different error:
>>> def function():
... return varname()
...
>>> xxx = function()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in function
File "/home/ubuntu/.local/lib/python3.9/site-packages/varname/core.py", line 106, in varname
raise VarnameRetrievingError("Unable to retrieve the ast node.")
varname.utils.VarnameRetrievingError: Unable to retrieve the ast node.
I think the idea behind the module though is a very good idea. Don't let it discourage you that there seems to be problems on the most recent versions of Python. This is a cool and useful hack. If you can get it working let me know! I have an elegant use-case in my state machine code.
The text was updated successfully, but these errors were encountered:
Hello, I'm trying to use this package on Python 3.9.7 (very recent I know) and the sample code throws errors. Here are the results:
Then I also tried the following and got a different error:
I think the idea behind the module though is a very good idea. Don't let it discourage you that there seems to be problems on the most recent versions of Python. This is a cool and useful hack. If you can get it working let me know! I have an elegant use-case in my state machine code.
The text was updated successfully, but these errors were encountered: