Skip to content
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

Avoid useless runtime type checks when coercing a None default argument to a Python type argument. #5652

Merged
merged 2 commits into from Aug 26, 2023

Conversation

scoder
Copy link
Contributor

@scoder scoder commented Aug 26, 2023

For Python int (which we turn into a plain Python object type internally to avoid Py2 int/long issues), we previously generated a type check which made the None default argument much more complex than it was.

Closes #5643

…nt to a Python type argument.

For Python int (which we turn into a plain Python object type internally to avoid Py2 int/long issues), we previously generated a type check which made the None default argument much more complex than it was.

Closes cython#5643
… tuple on cascaded assignments (test_grammar.py, line 895) because we do not generate a (useless) PyTypeTestNode any more.

Apparently, that type test is still required in order to trigger the Python conversion, which then renders the type test redundant.
@scoder scoder added this to the 3.0.2 milestone Aug 26, 2023
@scoder scoder merged commit 351e13c into cython:master Aug 26, 2023
68 of 76 checks passed
@scoder scoder deleted the gh5643_none_default branch August 26, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Cython 3.0.1 compile time crash: None Default Value
1 participant