Open in CoCalc

Hi,

If you want to play around with a copy of Sage built using Python3 instead of Python2 (so 'export SAGE_PYTHON3="yes"') without having to build or install anything, send me an email ([email protected]) and I'll add you to a CoCalc project that has Sage built that way.

See how long until it breaks for you on your favorite Sage commands. For me, it broke pretty quickly:

sage: print(2,3)
2 3
sage: range(10)
range(0, 10)
sage: {'a', 'b'}
{'a', 'b'}
sage: M = ModularSymbols(23)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-b5f2062004dc> in <module>()
----> 1 M = ModularSymbols(Integer(23))

/home/user/sage/local/lib/python3.6/site-packages/sage/modular/modsym/modsym.py in ModularSymbols(group, weight, sign, base_ring, use_cache, custom_init)
    346     key = canonical_parameters(group, weight, sign, base_ring)
    347
--> 348     if use_cache and key in _cache:
    349          M = _cache[key]()
    350          if not (M is None): return M

TypeError: unhashable type: 'Gamma0_class_with_category'

-- William

Note by Samuel: as Erik Bray pointed out on sage-devel, things got better for modular symbols in Sage 8.4.rc0.

Illustration:

sage: print(version())      # version of Sage
SageMath version 8.4.rc0, Release Date: 2018-10-07
sage: print(sys.version)    # version of Python
3.6.6 (default, Oct  8 2018, 20:46:03)
[GCC 7.3.0]
sage: print(2, 3)
2 3
sage: range(10)
range(0, 10)
sage: {'a', 'b'}
{'a', 'b'}
sage: M = ModularSymbols(23)
sage: M
Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
sage: M.basis()
((1,0), (1,17), (1,19), (1,20), (1,21))

To learn more about modular symbols:

To participate in the effort to port Sage to Python 3, see: