"@experimental" decorator, doctests, and py2 vs. py3

28 views
Skip to first unread message

John H Palmieri

unread,
Apr 4, 2019, 5:14:32 PM4/4/19
to sage-devel
I am confused about how Sage's doctests work with a deprecation warning, for example as coming from the @experimental decorator. Here is a snippet from the top of rings/padics/padic_lattice_element.py:

    sage: R = ZpLC(2)
    doctest:...: FutureWarning: This class/method/function is marked as experimental. It, its functionality or its interface might change without a formal deprecation.
    See http://trac.sagemath.org/23505 for details.
    sage: TestSuite(R).run(skip=['_test_teichmuller', '_test_matrix_smith']) # long time

    sage: R = ZpLF(2)
    sage: TestSuite(R).run(skip=['_test_teichmuller', '_test_matrix_smith']) # long time

    sage: R = QpLC(2)
    sage: TestSuite(R).run(skip=['_test_teichmuller', '_test_matrix_smith']) # long time

    sage: R = QpLF(2)
    sage: TestSuite(R).run(skip=['_test_teichmuller', '_test_matrix_smith']) # long time

If I run this in an actual Sage session, all four commands give the "FutureWarning". This is what I would expect, since four different functions are being run. Doctests with Python 2 pass. Doctests with Python 3 fail because a warning is produced for all four commands. (If you repeat any of the commands, no warning is produced the second time, either with py2 or py3.) It seems to me that Python 3, not Python 2, is acting the way I would expect. Is this a bug in Sage + Python 2?

--
John

Reply all
Reply to author
Forward
0 new messages