Skip to content

Fix runtime bugs seen from GS3.m in per_expr()#937

Merged
rocky merged 2 commits intomasterfrom
Python2-divide-incompatibility
Oct 3, 2020
Merged

Fix runtime bugs seen from GS3.m in per_expr()#937
rocky merged 2 commits intomasterfrom
Python2-divide-incompatibility

Conversation

@rocky
Copy link
Copy Markdown
Member

@rocky rocky commented Oct 2, 2020

per_expr() needs to return a in interator return, not the default implied
return None as can happen.

In Python 3, // is used for truncated integer division. In Python 2 it
was /. That now returns float in Python 3.

Note the brokenness of self.get_wrappings

To reproduce brokenness before build, in mathics run:

   <<"https://raw.githubusercontent.com/rebcabin/Mathics/master/mathics/packages/GS3.m"

per_expr() needs to return a in interator return, not the default implied
`return None` as can happen.

In Python 3, // is used for truncated integer division. In Python 2 it
was /. That now returns float in Python 3.

Note the brokenness of self.get_wrappings

To reproduce brokenness before build, in `mathics` run:
```
   <<"https://raw.githubusercontent.com/rebcabin/Mathics/master/mathics/packages/GS3.m"
```
@rocky rocky requested review from GarkGarcia and mmatera October 2, 2020 23:09
@rocky
Copy link
Copy Markdown
Member Author

rocky commented Oct 2, 2020

Although this doesn't fully fix GS3.m mentioned in the PR, it doesn't give a traceback most likely closer to correct.

Comment thread mathics/core/pattern.py
Comment thread mathics/core/pattern.py Outdated
@GarkGarcia GarkGarcia added the bug label Oct 3, 2020
I'm still not 100% this is correct, just probably and circumstantially
correct.
@rocky rocky merged commit 29de41a into master Oct 3, 2020
@rocky rocky deleted the Python2-divide-incompatibility branch October 7, 2020 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants