Closed mantepse closed 5 years ago
Author: Martin Rubey
Description changed:
---
+++
@@ -1 +1 @@
-
+python3 likes modifying a dict one is iterating over even less than python2.
Dependencies: #25899
Might this help with #17908 and #25905? Should there also be a register_symbol
for abs
?
I didn't know about #17908, thank you for notifying me! Yes, the cure is very likely now simply adding the translation of abs
, I'll keep this in mind.
this ticket is unrelated to the two above, it only provides a python3 fix. However, to avoid merge conflicts, I'd like to get in this ticket and #26068 first, I'll then do #17908.
Replying to @mantepse:
... thank you for notifying me! ...
You can query Trac for all tickets whose summary contains "fricas":
Changed keywords from none to FriCAS
Branch pushed to git repo; I updated commit sha1. New commits:
9a6ec3d | Merge branch 'develop' of git://trac.sagemath.org/sage into t/27268/py3__fix_fricas_interface |
Reviewer: Travis Scrimshaw
Actually, the problem is this line: (var, poly) = rootOf.items()[i]
. The result of items()
is a view, which does not support indexing (in a way, think of it like an iterator). However, since your changes work and the code looks cleaner, positive review.
Replying to @tscrim:
Actually, the problem is this line:
(var, poly) = rootOf.items()[i]
.
Yes, the error message and trace did show that.
The result of
items()
is a view, which does not support indexing (in a way, think of it like an iterator). However, since your changes work and the code looks cleaner, positive review.
General question: should I modify the ticket description once I know the root of the problem? The downside is that the history how the bugfix developed is sometimes not as easy to understand anymore.
Yes, in this case it probably is better to modify it so that people have an easier time seeing the issue (rather than reading the comments).
Description changed:
---
+++
@@ -1 +1 @@
-python3 likes modifying a dict one is iterating over even less than python2.
+In python3, `dict.items` cannot be indexed. The processing of `rootOf` expression assumed this, so the design pattern must be changed.
Changed branch from u/mantepse/py3__fix_fricas_interface to 9a6ec3d
In python3,
dict.items
cannot be indexed. The processing ofrootOf
expression assumed this, so the design pattern must be changed.Depends on #25899
CC: @fchapoton
Component: python3
Keywords: FriCAS
Author: Martin Rubey
Branch/Commit:
9a6ec3d
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/27268