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

已查看 28 次
跳至第一个未读帖子

John H Palmieri

未读,
2019年4月4日 17:14:322019/4/4
收件人 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

回复全部
回复作者
转发
0 个新帖子