#18796: Python 3 preparation: Cleaning up the bit rot that occurred to a
number of
Python 3 fixes
-------------------------+-------------------------------------------------
Reporter: | Owner:
wluebbe | Status: needs_work
Type: | Milestone: sage-6.8
enhancement | Resolution:
Priority: major | Merged in:
Component: misc | Reviewers:
Keywords: | Work issues:
python3 | Commit:
Authors: | 3b23e78b2387240a738862417fe66070856c2c68
Wilfried Luebbe | Stopgaps:
Report Upstream: N/A |
Branch: |
u/wluebbe/18796 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by wluebbe):
Replying to [comment:6 jdemeyer]:
> Why do you replace
> ...
All the changes were generated by {{{2to3 -w -f idioms src/sage}}}.
While {{{type(self) == type(other)}}} means strict type identity the
expression {{{isinstance(self, type(other))}}} allows subclasses. The
Python documentation
(https://docs.python.org/2.7/library/functions.html?highlight=type#type)
says: //The isinstance() built-in function is recommended for testing the
type of an object.//
There was one generated change (see comment:1) that I reverted because of
failing doctests. Failing of doctests was the only method I used to
determine that the change was not correct. I have no deep understanding of
the code.
Therefor one can reason that without more insight all changes from
{{{type()}}} to {{{isinstance()}}} should be reverted.
Or to keep them until proved guilty.
Remark: In ticket #15984 we made a large number of such changes supported
by the same reasoning. This was in Sage 6.2 15 month ago. So there is some
evidence that the approach is reasonable.
--
Ticket URL: <http://trac.sagemath.org/ticket/18796#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.