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

We can tolerate PyPy now... #1139

Merged
merged 3 commits into from
Oct 21, 2024
Merged

We can tolerate PyPy now... #1139

merged 3 commits into from
Oct 21, 2024

Conversation

rocky
Copy link
Member

@rocky rocky commented Oct 20, 2024

Fixes #661

@rocky rocky requested a review from mmatera October 20, 2024 20:11
@@ -29,7 +29,7 @@ def eval_N(
expression: BaseElement,
evaluation: Evaluation,
prec: BaseElement = SymbolMachinePrecision,
) -> BaseElement:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type mismatch and the one above were noticed when looking at another bug we have.

There is pollution to values of some non-Python data. (Probably some structure is modifying a list in place).

A fix for the underlying problem will occur down the line.

@@ -134,7 +134,7 @@ def quiet_f(*args):


def eval_ListPlot(
plot_groups: list,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it not be better to ensure using one type or the other?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm...

plot_groups is sometimes the result of expr.to_python(). For a ListExpression this is a list.
In the case of constant data we have a tuple; here, this is synonymous with an immutable list.

I think plot_groups should be a tuple - immutable. However, I don't think we can change the return type of to_python() and I don't think we can change it to tuple on return without first detecting that it is a list. Otherwise, we would be wrapping a scalar into a tuple.

So, while I agree it would be better to ensure a tuple is passed in, at this stage, I am not sure I want take the risk of converting a list to tuple right now.

I have made note of this issue though in commit 016f6be

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I think it would be enough by now.

Copy link
Contributor

@mmatera mmatera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rocky rocky merged commit e7ca026 into master Oct 21, 2024
11 checks passed
@rocky rocky deleted the reinstate-PyPy branch October 21, 2024 02:26
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.

PyPy not supported
2 participants