Skip to content

Work around cython parameter passing bug. #81

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

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

deinst
Copy link
Contributor

@deinst deinst commented Sep 12, 2023

In the words of Mae West, "goodness had nothing to do with it".

In this case, she was wrong though, __goodness tickled a cython code generation bug if __goodness was compiled as a cdef function.

Made __goodness work as a cdef function by removing its default parameter values.

Boiling this down to a human comprehensible example suitable for a cython bug report is a work in progress.

It appears that cython has a bug in passing parameters with defaults to some recursive functions. __goodness is one of them. In this case if any of the parameters had defaults parts was passed a 0 (False). Removing the defaults fixes this.

Also added the showgood submodule to the list of submodules to doctest.

Made `__goodness` work as a cdef function.

It appears that cython has a bug in passing parameters with defaults to some
recursive functions.  `__goodness` is one of them.  In this case if any of the
parameters had defaults `parts` was passed a 0 (False).  Removing the defaults
fixes this.

Also added the `showgood` submodule to the list of submodules to doctest.
@oscarbenjamin
Copy link
Collaborator

Nice.

Does this make showgood faster at all?

@oscarbenjamin oscarbenjamin merged commit 11bb708 into flintlib:master Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants