guppylang
guppylang copied to clipboard
Py keyword takes precedence over identifier with the same name
What happens if I write
@guppy
def f() -> int:
py = lambda x: x+1
return py(2)
?
Originally posted by @aborgna-q in https://github.com/CQCL/guppylang/pull/515#discussion_r1782506340
In see two options:
- Turn
pyinto an actual function and use a CustomCallChecker - Disallow naming variables py since it's a "keyword"
I'd say option 1 is the more pythonic. There are no function keywords in python3.
From a user perspective, if you can shadow print you should be able to do the same with py.