-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip building trees for nodes with invalid tag name #5690
Conversation
This change attempts to exclude arguments with invalid tag names from being inserted into the TreeBuilder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main thing it's missing is a test - probably just to check that a generator expression doesn't break it the build
def f(a, b):
return (x for x in range(a, b))
is probably sufficient to hit the bug I think.
Unfortunately I'm not really sure how gdb mode is tested: probably in Cython/Debugger/Tests but I've never looked in there myself
Documented the purpose of is_valid_tag function in its docstring.
I attempted to validate the fix by locally running python ../cython/cython.py --cplus --gdb a.pyx --output-file a.cxx
g++ -fPIC a.cxx $(python3-config --includes) $(python3-config --ldflags) -shared -o a$(python3-config --extension-suffix) Then
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that we really need to change start()
and end()
as well, but it's probably better to be consistent.
Looks good to me now. |
Thanks |
cython/cython#5690 cython/cython#5725 Both are merged in cython 3.0.3, however that release breaks scipy.
cython/cython#5690 cython/cython#5725 Both are merged in cython 3.0.3, however that release breaks scipy.
This change attempts to exclude arguments with invalid tag names from being inserted into the
TreeBuilder
as per comment from gh-5552.It does resolve the exception reported in gh-5552 and in gh-5686, but I am not sure whether this is the best way to implement the idea to skip nodes with invalid names.
Please feel free to suggest improvements.