#15995: Python 3 preparation: Adapt to the changed integer division semantics (/
vs. //)
--------------------------------+------------------------
Reporter: wluebbe | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.2
Component: distribution | Resolution:
Keywords: python3 | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
--------------------------------+------------------------
Comment (by wluebbe):
I finally manage to run the doctests with the Python command line option
{{{-3}}}. This is how I did it:
{{{
...:~/sage-6.2.beta8$ . src/bin/sage-env
...:~/sage-6.2.beta8$ python -3 ./local/bin/sage-runtests src/sage 1>logs
/sage-warnings3-stdout.txt 2>logs/sage-warnings3-stderr.txt
}}}
A summary of {{{stderr}}} output is
{{{
nbr_lines= 133
83 Overriding __eq__ blocks inheritance of __hash__ in 3.x
27 classic int division
18 type inequality comparisons not supported in 3.x
2 the cmp argument is not supported in 3.x
1 execfile() not supported in 3.x; use exec()
1 file.softspace not supported in 3.x
1 tmpfile has been removed in 3.x; use the tempfile module
}}}
and of {{{stdout}}}
{{{
nbr_lines= 39630
19386 type inequality comparisons not supported in 3.x
8779 Overriding __eq__ blocks inheritance of __hash__ in 3.x
4039 CObject type is not supported in 3.x. Please use capsule objects
instead.
2139 reduce() not supported in 3.x; use functools.reduce()
2017 classic int division
2000 the cmp argument is not supported in 3.x
789 comparing unequal types not supported in 3.x
262 __getitem__ not supported for exception classes in 3.x; use args
attribute
88 sys.exc_clear() not supported in 3.x; use except clauses
57 in 3.x, __getslice__ has been removed; use __getitem__
14 file.softspace not supported in 3.x
12 the commands module has been removed in Python 3.0; use the
subprocess module instead
7 execfile() not supported in 3.x; use exec()
7 tmpfile has been removed in 3.x; use the tempfile module
5 dict inequality comparisons not supported in 3.x
3
2 Use the Permutations object instead.
2 This class is replaced by
Matrix_modn_dense_float/Matrix_modn_dense_double.
2 to_permutation() is deprecated. Use instead
reading_word_permutation()
2 this class is deprecated. Use RibbonShapedTableau instead
2 BaseException.message has been deprecated as of Python 2.6
2 The 'new' module has been removed in Python 3.0; use the 'types'
module instead.
2 this is done automatically by the doctest framework
2 derangements() is deprecated. Use Derangements instead.
1 The output of Transducer.cartesian_product will change. Please use
Transducer.intersection for the original output.
1 Substitution using function-call syntax and unnamed arguments is
deprecated and will be removed from a future release of Sage; you can use
named arguments instead, like EXPR(x=..., y=...)
1 This method is deprecated. Use triangulate() instead.
1 In 3.x, reload() is renamed to imp.reload()
1 dict.has_key() not supported in 3.x; use the in operator
1 The output of
1 Substitution using
1 This method is deprecated. Use triangulate().simplicial_complex()
instead.
1 Variable of integration should be specified explicitly.
1 OrderedAlphabet is deprecated; use Alphabet instead.
}}}
Unfortunately typical {{{stdout}}} printout looks like
{{{
**********************************************************************
File "src/sage/modular/modsym/space.py", line 929, in
sage.modular.modsym.space.ModularSymbolsSpace._q_expansion_module
Failed example:
ModularSymbols(11, 2,
base_ring=GF(4,'a')).cuspidal_submodule()._q_expansion_module(prec=4,
algorithm="hecke")
Expected:
Vector space of degree 4 and dimension 1 over Finite Field in a of
size 2^2
Basis matrix:
[0 1 0 1]
Got:
doctest:127: DeprecationWarning: type inequality comparisons not
supported in 3.x
doctest:511: DeprecationWarning: classic int division
doctest:250: DeprecationWarning: type inequality comparisons not
supported in 3.x
doctest:585: DeprecationWarning: classic int division
doctest:286: DeprecationWarning: classic int division
doctest:396: DeprecationWarning: classic int division
doctest:6464: DeprecationWarning: classic int division
Vector space of degree 4 and dimension 1 over Finite Field in a of
size 2^2
Basis matrix:
[0 1 0 1]
**********************************************************************
}}}
and I don't know how to correlate line likes {{{doctest:511}}} with the
original line.
The line in stderr are more useful, but are few and far between
{{{
~/sage-6.2.beta8/local/lib/python2.7/site-
packages/sage/groups/perm_gps/cubegroup.py:368: DeprecationWarning:
classic int division
2: [1/2,3/2,5/2], # ub
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/15995#comment:2>
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.