Replies: 2 comments
-
I suppose Warnings are hard to do well in proc macros (we have a bit of a nasty hack for deprecations). I would be open to a PR which made this an error with a |
Beta Was this translation helpful? Give feedback.
0 replies
-
A warning would be nice, but there isn't a proper way to emit warnings. Perhaps once something like rust-lang/rust#54140 lands we should do it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm pretty new to PyO3 and have just incidentally found out that PyO3 allows to compile a function or method with its name being equal to a reserved Python keyword such as
from
orimport
. Trying to call such a function from Python expectedly results in aSyntaxError: invalid syntax
.Shouldn't PyO3 prohibit compiling such functions or at least suggest to rename them? This isn't documented anywhere either.
Minimal Rust example to reproduce:
This fails in Python because
from
is a reserved keyword:What is your opinion?
Beta Was this translation helpful? Give feedback.
All reactions