passagemath-repl 10.5.17__py3-none-any.whl → 10.5.19__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. {passagemath_repl-10.5.17.dist-info → passagemath_repl-10.5.19.dist-info}/METADATA +3 -3
  2. {passagemath_repl-10.5.17.dist-info → passagemath_repl-10.5.19.dist-info}/RECORD +37 -37
  3. sage/doctest/control.py +2 -2
  4. sage/doctest/forker.py +31 -21
  5. sage/misc/cython.py +52 -2
  6. sage/misc/inline_fortran.py +1 -1
  7. sage/misc/sagedoc.py +7 -7
  8. sage/repl/attach.py +2 -2
  9. sage/repl/display/fancy_repr.py +12 -2
  10. sage/repl/image.py +1 -1
  11. sage/repl/ipython_extension.py +81 -2
  12. sage/repl/preparse.py +1 -1
  13. sage/repl/rich_output/display_manager.py +14 -6
  14. sage/repl/rich_output/pretty_print.py +1 -1
  15. sage/repl/user_globals.py +1 -1
  16. sage/tests/arxiv_0812_2725.py +3 -3
  17. sage/tests/book_stein_modform.py +35 -54
  18. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-cachegrind +0 -0
  19. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-callgrind +0 -0
  20. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-cleaner +0 -0
  21. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-coverage +0 -0
  22. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-eval +0 -0
  23. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-fixdoctests +0 -0
  24. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-inline-fortran +0 -0
  25. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-ipynb2rst +0 -0
  26. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-ipython +0 -0
  27. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-massif +0 -0
  28. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-notebook +0 -0
  29. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-omega +0 -0
  30. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-preparse +0 -0
  31. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-run +0 -0
  32. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-run-cython +0 -0
  33. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-runtests +0 -0
  34. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-startuptime.py +0 -0
  35. {passagemath_repl-10.5.17.data → passagemath_repl-10.5.19.data}/scripts/sage-valgrind +0 -0
  36. {passagemath_repl-10.5.17.dist-info → passagemath_repl-10.5.19.dist-info}/WHEEL +0 -0
  37. {passagemath_repl-10.5.17.dist-info → passagemath_repl-10.5.19.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: passagemath-repl
3
- Version: 10.5.17
3
+ Version: 10.5.19
4
4
  Summary: passagemath: IPython kernel, Sage preparser, doctester
5
5
  Author-email: The Sage Developers <sage-support@googlegroups.com>
6
6
  Maintainer: Matthias Köppe, passagemath contributors
@@ -28,8 +28,8 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
28
28
  Classifier: Topic :: Scientific/Engineering :: Mathematics
29
29
  Requires-Python: <3.13,>=3.9
30
30
  Description-Content-Type: text/x-rst
31
- Requires-Dist: passagemath-objects ~=10.5.17.0
32
- Requires-Dist: passagemath-environment ~=10.5.17.0
31
+ Requires-Dist: passagemath-objects ~=10.5.19.0
32
+ Requires-Dist: passagemath-environment ~=10.5.19.0
33
33
  Requires-Dist: ipykernel >=5.2.1
34
34
  Requires-Dist: ipython >=7.13.0
35
35
  Requires-Dist: ipywidgets >=7.5.1
@@ -1,30 +1,30 @@
1
- passagemath_repl-10.5.17.data/scripts/sage-cachegrind,sha256=FRrT4BoRsrATlQOrXALHAbDI_KLhz0XuDOD6xzECEl8,651
2
- passagemath_repl-10.5.17.data/scripts/sage-callgrind,sha256=pWhrI8NsVa_XSuay052htjxcM3thrpX8rI6Uj_pK5Uo,442
3
- passagemath_repl-10.5.17.data/scripts/sage-cleaner,sha256=vM0CkzbxiSCE0Z85AViQIvoxb5oUz5WOmVOvShbLDUY,7778
4
- passagemath_repl-10.5.17.data/scripts/sage-coverage,sha256=IhvqnFvmvNJBMQtiSu5_Qy52a67hG-r3cAeyhYOOj7w,10199
5
- passagemath_repl-10.5.17.data/scripts/sage-eval,sha256=4IHv01xH34wJPj61wzcL5ufhoO6Y3UTTGz7b-0YKJFw,266
6
- passagemath_repl-10.5.17.data/scripts/sage-fixdoctests,sha256=cTWoFr9rAdOF-xeW6ytNeX3EzhKcs1mTN4UilP4kiGg,36877
7
- passagemath_repl-10.5.17.data/scripts/sage-inline-fortran,sha256=T3U943WNPKrxQJuanBhTpXU3jJ5vjaXd56R8yWv_8PM,234
8
- passagemath_repl-10.5.17.data/scripts/sage-ipynb2rst,sha256=PynBPdthnpwGbILDRA38IwpT319Ze-g8UMmWaaTnimQ,1345
9
- passagemath_repl-10.5.17.data/scripts/sage-ipython,sha256=RYYd8-gmE5JE_-dCkOSDpC6rRsX6i6tma3pqgmXYJvM,342
10
- passagemath_repl-10.5.17.data/scripts/sage-massif,sha256=Tfqb6ON9d0OZnt6VlGS21asbdMq8zWzx8ZnvV1n_buI,613
11
- passagemath_repl-10.5.17.data/scripts/sage-notebook,sha256=QJ1Y4eTptc6TbNVXZswpcsn-NqaQNuSwjWE-lYmGpW8,8453
12
- passagemath_repl-10.5.17.data/scripts/sage-omega,sha256=4ARnHyZyB69ltxHj9xYpzad_YCBT3Nk0Wq3Ke09gExM,595
13
- passagemath_repl-10.5.17.data/scripts/sage-preparse,sha256=3L1KKgvSApvoK467Wza0S4WQLCXiYvivrhDKIvA1omc,10595
14
- passagemath_repl-10.5.17.data/scripts/sage-run,sha256=F1oAgPN7Kh5dO1smCyfGVT0Dy46NQ_dQ3OQZ8Wa6foM,689
15
- passagemath_repl-10.5.17.data/scripts/sage-run-cython,sha256=02mTGXokayRxISoCWWsDcKZwGrmh5B0mJJxTT87J01Q,235
16
- passagemath_repl-10.5.17.data/scripts/sage-runtests,sha256=nUvI3fCrBjqPUict01wIxwYPjvaZf4ttLp85tavUEpY,111
17
- passagemath_repl-10.5.17.data/scripts/sage-startuptime.py,sha256=RtIuC7jM3SOwROXTa6nnpJhzK0sQ24nDqyE6zXpCWEI,6209
18
- passagemath_repl-10.5.17.data/scripts/sage-valgrind,sha256=fZxy00oXU4PpHf_wc2uYKb7lzqSBY4VkhUxiuvXHKhA,1201
1
+ passagemath_repl-10.5.19.data/scripts/sage-cachegrind,sha256=FRrT4BoRsrATlQOrXALHAbDI_KLhz0XuDOD6xzECEl8,651
2
+ passagemath_repl-10.5.19.data/scripts/sage-callgrind,sha256=pWhrI8NsVa_XSuay052htjxcM3thrpX8rI6Uj_pK5Uo,442
3
+ passagemath_repl-10.5.19.data/scripts/sage-cleaner,sha256=vM0CkzbxiSCE0Z85AViQIvoxb5oUz5WOmVOvShbLDUY,7778
4
+ passagemath_repl-10.5.19.data/scripts/sage-coverage,sha256=IhvqnFvmvNJBMQtiSu5_Qy52a67hG-r3cAeyhYOOj7w,10199
5
+ passagemath_repl-10.5.19.data/scripts/sage-eval,sha256=4IHv01xH34wJPj61wzcL5ufhoO6Y3UTTGz7b-0YKJFw,266
6
+ passagemath_repl-10.5.19.data/scripts/sage-fixdoctests,sha256=cTWoFr9rAdOF-xeW6ytNeX3EzhKcs1mTN4UilP4kiGg,36877
7
+ passagemath_repl-10.5.19.data/scripts/sage-inline-fortran,sha256=T3U943WNPKrxQJuanBhTpXU3jJ5vjaXd56R8yWv_8PM,234
8
+ passagemath_repl-10.5.19.data/scripts/sage-ipynb2rst,sha256=PynBPdthnpwGbILDRA38IwpT319Ze-g8UMmWaaTnimQ,1345
9
+ passagemath_repl-10.5.19.data/scripts/sage-ipython,sha256=RYYd8-gmE5JE_-dCkOSDpC6rRsX6i6tma3pqgmXYJvM,342
10
+ passagemath_repl-10.5.19.data/scripts/sage-massif,sha256=Tfqb6ON9d0OZnt6VlGS21asbdMq8zWzx8ZnvV1n_buI,613
11
+ passagemath_repl-10.5.19.data/scripts/sage-notebook,sha256=QJ1Y4eTptc6TbNVXZswpcsn-NqaQNuSwjWE-lYmGpW8,8453
12
+ passagemath_repl-10.5.19.data/scripts/sage-omega,sha256=4ARnHyZyB69ltxHj9xYpzad_YCBT3Nk0Wq3Ke09gExM,595
13
+ passagemath_repl-10.5.19.data/scripts/sage-preparse,sha256=3L1KKgvSApvoK467Wza0S4WQLCXiYvivrhDKIvA1omc,10595
14
+ passagemath_repl-10.5.19.data/scripts/sage-run,sha256=F1oAgPN7Kh5dO1smCyfGVT0Dy46NQ_dQ3OQZ8Wa6foM,689
15
+ passagemath_repl-10.5.19.data/scripts/sage-run-cython,sha256=02mTGXokayRxISoCWWsDcKZwGrmh5B0mJJxTT87J01Q,235
16
+ passagemath_repl-10.5.19.data/scripts/sage-runtests,sha256=nUvI3fCrBjqPUict01wIxwYPjvaZf4ttLp85tavUEpY,111
17
+ passagemath_repl-10.5.19.data/scripts/sage-startuptime.py,sha256=RtIuC7jM3SOwROXTa6nnpJhzK0sQ24nDqyE6zXpCWEI,6209
18
+ passagemath_repl-10.5.19.data/scripts/sage-valgrind,sha256=fZxy00oXU4PpHf_wc2uYKb7lzqSBY4VkhUxiuvXHKhA,1201
19
19
  sage/all__sagemath_repl.py,sha256=z6lERTYuw3I4LQ7-hnEYbY1i-hMJj2uAm2ujOmWitSo,5713
20
20
  sage/doctest/__init__.py,sha256=JJMNkq7Rh3gCshtynqXDTLJgUKweNFlUhpnbvTLRMwg,166
21
21
  sage/doctest/__main__.py,sha256=wGVNiaPbhQwzoAs3Y1xhYBlB18pBieEDhi71ggF8NkQ,13647
22
22
  sage/doctest/all.py,sha256=SRWEXRjzsrFyY1rrErA7--1DrvjUQR0Th30P6vubnZ0,157
23
23
  sage/doctest/check_tolerance.py,sha256=YnYr981uSUZWfuv5OrXdytXsZx6PtJnQ7Mg8-Lj7pB4,8945
24
- sage/doctest/control.py,sha256=5XCW_4_eilZaSEhWas-7Y1VFwF_fULkp4a21z8TdWDs,67879
24
+ sage/doctest/control.py,sha256=4JBsC9GRFdAPPDTunknFx29Ea2KcFHVjJAceIHSGEyY,67877
25
25
  sage/doctest/external.py,sha256=ddr7S0bt1bqAHWyAQj0z4O1SrjwgpdY7ghDt4KZzDRo,15601
26
26
  sage/doctest/fixtures.py,sha256=UDSykekKanmnD737VXFv7r5QzcZmqzfwn1Noc_fKcnE,12784
27
- sage/doctest/forker.py,sha256=QhRJE8zV_KV0o8-4SX0tAzP49uZkYtsLY1mAkRDopI0,110831
27
+ sage/doctest/forker.py,sha256=fSegaM91S6Seujl1v31_fwMQzITuzoByV81TYa_Solg,111015
28
28
  sage/doctest/marked_output.py,sha256=EJThXbkhYvYR5r1uuZyfPjeYHiLpHUgqTm1QZ5JTDgw,3034
29
29
  sage/doctest/parsing.py,sha256=GJRQRKX1cwr8fM5Gu2WxbxU3q8avsIskbH-7I2okjss,72167
30
30
  sage/doctest/parsing_test.py,sha256=7v3Y6kgLr7x5UF3CkdyNbRyhH4VRX275QPdCqG-jMxg,2652
@@ -57,12 +57,12 @@ sage/misc/banner.py,sha256=69sC578x0-t8a_l14w08xMLPBp0wcd8RsdTrcJq7ERQ,7883
57
57
  sage/misc/benchmark.py,sha256=4hW6hTGWfPb_E_U8V19Y_CPRN9_mUMsefrIb1rkzhfQ,6162
58
58
  sage/misc/classgraph.py,sha256=e9xZbH4cZhkY8uuNL-PrS1tyFXm8JcnhyE8uTDYOCoE,5155
59
59
  sage/misc/copying.py,sha256=jyY_AyAAFHAYGkj6Ca-kRd-PcW4qg18kDIUp1dVPk0M,423
60
- sage/misc/cython.py,sha256=ha1nB4ogvx12KM_RXdIIrICXhd0u6X2NtOaiFJrJ1Dg,24281
60
+ sage/misc/cython.py,sha256=5BfZp_zldl3OxEplkEwk-UkNYjxz-rpVXvi9-LGD9Vw,25849
61
61
  sage/misc/dev_tools.py,sha256=7Op4JFUXiYjUHN1lxO7blEVDr3vwYzDujO70XjwNDUE,28380
62
62
  sage/misc/edit_module.py,sha256=A3EctK2BgolhFtsCXtiShKzr_c0r3eGmb9HYnKPyOto,10528
63
63
  sage/misc/explain_pickle.py,sha256=KLuoOx_7xEeawgnLvheim4qmgMhPPOL0CcRxbP7CpWM,107704
64
64
  sage/misc/gperftools.py,sha256=ZXGxmNSnp9EdBOVwcTPgiJrmH3EbW4bgp7vOWLNgZNA,10909
65
- sage/misc/inline_fortran.py,sha256=p2-MqigIL2-qQ9oyqUVX9r7dVtHihmyXh-_-1eb25TM,6837
65
+ sage/misc/inline_fortran.py,sha256=EFTYpw420JNKZdNNSuOcD4_TONPnfJRZ0UX9PZUO5so,6838
66
66
  sage/misc/messaging.py,sha256=NdHinsgrUq3Kd8QC-c8oIHqt3_hPQ2hEd20rih91qgY,3203
67
67
  sage/misc/pager.py,sha256=bTxQlO2MuJ54ZulqzkcpDW5Yoseile5M9q7RoklrLU0,664
68
68
  sage/misc/profiler.py,sha256=r9M0GKmxEzWpZVuemY1ch03fd_zZz8kKpcEDXD8W-0k,5753
@@ -70,25 +70,25 @@ sage/misc/python.py,sha256=qUdAqlft8VD4oG8U0iWN-r8RXGpGwD70K_00r4REXlo,1840
70
70
  sage/misc/remote_file.py,sha256=p3t4NT4_c0xUI8pLqWaw4RE0NX_O3a5K0VL3-W8wZqo,1545
71
71
  sage/misc/sage_eval.py,sha256=hvBRBay5CoInQM6NDNOaTV1_AYTgj2O_VGIst1uLuQ8,7780
72
72
  sage/misc/sage_input.py,sha256=MWivkHNX5SnWBvE5UM-baPK2kOhRip8rHgs7OyEE-Rg,121020
73
- sage/misc/sagedoc.py,sha256=2TGdwR9tOc4Y0Vx2PpcfnKWs6KVCyDxhsauO9yKRiqI,67656
73
+ sage/misc/sagedoc.py,sha256=W2ZQxJd3JsbzdhnpZx5gvlzJgAav3byr8iHXUzfIW6U,67584
74
74
  sage/misc/sh.py,sha256=4aogzam8JR0jtvWOM5CXycjPjWqUNs7Pc9l0fNwmwuw,1446
75
75
  sage/misc/trace.py,sha256=xEwmVVALZ7aCciIRpspoY4IJuE1T9502P5KL2VH0yl0,2978
76
76
  sage/repl/__init__.py,sha256=n6Dp28k-5BZmi9cePkg8G6S9qFWUGPBiFVRSiwsPLqk,663
77
77
  sage/repl/all.py,sha256=nh532qefRODsltlLeN-zFkX8UHc6g09pFh5gdIvMORI,508
78
- sage/repl/attach.py,sha256=tgnViiFNPZWsxw_FNpoKTmkVXX1NJmhVeWNOIlmwYa8,19805
78
+ sage/repl/attach.py,sha256=XkGHf5OTMAwnTDqqRT6sw92G5pWMVDUueXrYAlWZQ40,19811
79
79
  sage/repl/configuration.py,sha256=rYmzn3UV6Azp4-_Dzq2b3YxmSsZ-0ZjYIoWiDQpqHo8,6040
80
- sage/repl/image.py,sha256=yrzjDnCdtbS5ZVnszqEgqctrL1s7nnFVtrs_TsuMciQ,9343
80
+ sage/repl/image.py,sha256=wS_m2idzx2PuKjh8yCj18RUi6MT1_C08oH3VaeUKieA,9337
81
81
  sage/repl/inputhook.py,sha256=o3Z6kWs_37yOBMZzoJNj48ajAc3KkMW3M8gydruEFrY,2506
82
82
  sage/repl/interface_magic.py,sha256=WFAC_HHNmenOfCF8IXq3FOnNGX799BiEJdkg7p346f4,9412
83
83
  sage/repl/interpreter.py,sha256=EL0grJK963zyiVg2Gki3XtGLCOG8pWdqvHVCBB8pLiI,30435
84
- sage/repl/ipython_extension.py,sha256=mTwt4-z9MCBh8OFj_FqlHa44FCLoNSh6V6_R2cs-yPg,23164
84
+ sage/repl/ipython_extension.py,sha256=w9fLDxYKiZolJRTwpzjxFOoEhKpyuz2bQkyIbGFUS-k,26418
85
85
  sage/repl/ipython_tests.py,sha256=6sXyZJnKMcXeS7wvBZ8X6Lx6juBy27RDxLbmsrEVY20,4807
86
86
  sage/repl/load.py,sha256=njH3sRvMV56p0-Nbe2IpQqA6u2k0rxAPfCVWdCHvdzk,11824
87
- sage/repl/preparse.py,sha256=fkMBb1voFvGD1iagtQk2nareICdHZpkJmAqOYEI_yOo,77110
87
+ sage/repl/preparse.py,sha256=ktz7bWppMvtBTSpOs6EPC76nKuna9MFsX3txoZJt5WY,77117
88
88
  sage/repl/prompts.py,sha256=wyd7z3sdOaOevvnqfwrQBiCaj6hLiWYJ3De6eePbQEA,2253
89
- sage/repl/user_globals.py,sha256=FQA7tNioBoyHNw8SQCbA_teqMVtPRTYlql44KeYA18w,5930
89
+ sage/repl/user_globals.py,sha256=2jSYA41XFom4HH3vHTu6oqxOOlPDPMLUDkxtmqGSGG0,5944
90
90
  sage/repl/display/__init__.py,sha256=6mNw0BEw6mZsoOi004elrLvD4m4RffLmgY921IwsNXk,43
91
- sage/repl/display/fancy_repr.py,sha256=A1e8yAWo4ikfNEEQ2zCs8fLyrpN-xCOOpN6enV1Hgvg,10577
91
+ sage/repl/display/fancy_repr.py,sha256=FdZi4inCBJqzQBJ8a4ol1b7lUn5KDatyHAqo3onLC74,11086
92
92
  sage/repl/display/formatter.py,sha256=LR7PY589xx5Ra_8DJ2mo4RBnXKq5a6g84cu-FlIYtiI,12712
93
93
  sage/repl/display/jsmol_iframe.py,sha256=qj8o_OhkokCk2MSU9AMV6jheYrSdMp1D7AvDCohoOw8,8989
94
94
  sage/repl/display/pretty_print.py,sha256=ZPR-UbfS9ZifG5tybWI4GSAYGxeDin8MLc6XENNpu9Q,4861
@@ -107,7 +107,7 @@ sage/repl/rich_output/backend_doctest.py,sha256=GUIcwHXWvTN16PFm3v4ZThk8F5FFnSkh
107
107
  sage/repl/rich_output/backend_emacs.py,sha256=lFlPjVe7XPju9yVl92YVNGoKMQS-37GqSBbZkBbpAFk,5919
108
108
  sage/repl/rich_output/backend_ipython.py,sha256=-TTxvWX35xcJw-ZX2L0QGDMEvusb3xbaTqKTS-BWeZ0,22126
109
109
  sage/repl/rich_output/buffer.py,sha256=Lh2P_VBNQI8HIqwlyTmJ5uTsjg1sOWPeQ1tHdEnLns8,9928
110
- sage/repl/rich_output/display_manager.py,sha256=Lj2DNW-aP96D7w-0tmwDT83v_wPJOlEi2DMt4peP8Uo,29462
110
+ sage/repl/rich_output/display_manager.py,sha256=n4UKuI_2-otvtsc0aLAlOAB2wOf_XrqIrzA9pshCB5k,29715
111
111
  sage/repl/rich_output/example.avi,sha256=my4VexWs4c2gFV9mpO-BjvCMj1I241FjHkpk3-hQ8BY,7976
112
112
  sage/repl/rich_output/example.canvas3d,sha256=mT094XaOVY5oJ5iu4RyOXfcaKWbo2IktOyA5FJ09aMo,829
113
113
  sage/repl/rich_output/example.dvi,sha256=DdcTpMhkpPXSPiRJ_EexkihWPLgrykecbRUxFnJgb8k,212
@@ -133,16 +133,16 @@ sage/repl/rich_output/output_graphics.py,sha256=dFU3lWWpT4rCn-7n4CUezCfhcDMv-0XA
133
133
  sage/repl/rich_output/output_graphics3d.py,sha256=UtKxX-9MooS2GK4E730ag2uBjrNbdp38XaIyfdvacj0,11844
134
134
  sage/repl/rich_output/output_video.py,sha256=4-yQKBCr785qnb2Hdp2E8Ds39WbhNI5moHTlnu_s2Lw,6485
135
135
  sage/repl/rich_output/preferences.py,sha256=AQNOC0RrkcVXsvMAfyAw1IJJgbG6Xd2YjAUt_LPzcJU,12896
136
- sage/repl/rich_output/pretty_print.py,sha256=RQYNkwwMBRZGaXgw1Bff1VdxSHVui5y-azaqWBC9IdQ,11054
136
+ sage/repl/rich_output/pretty_print.py,sha256=jtyu24T9vhStc74fRXKZFD5XAR8e3LJWs10kNK5V4fk,11057
137
137
  sage/repl/rich_output/test_backend.py,sha256=lWvrkhnjXBMw4kAoBW2F0qJXRXk-tBnbQj1MJKHVH0A,6607
138
138
  sage/tests/all.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
139
139
  sage/tests/all__sagemath_repl.py,sha256=U0L7QUQRA5DQQ1cqv8tjHB1fr4uXj_q6q_H6e44PTh0,51
140
140
  sage/tests/article_heuberger_krenn_kropf_fsm-in-sage.py,sha256=bam9TtDj7Wic1Fs5XL3TOX0G4svjBqF7jmAa4vnWZsQ,19928
141
- sage/tests/arxiv_0812_2725.py,sha256=Ts2xNNLCb5wl05xxMfB5h4YhVFuLEr6CWl-D4LQj-yM,9959
141
+ sage/tests/arxiv_0812_2725.py,sha256=x1oO2O50QnrCm-zK2Wopzr5SnOlRz0LzNUo_AUORdZE,9942
142
142
  sage/tests/benchmark.py,sha256=XY3VTPMklhoM2m-8dxs3sypbeoo-gLFS9ZbWD7UBbYU,55488
143
143
  sage/tests/book_schilling_zabrocki_kschur_primer.py,sha256=mIr3XlcQKQXxjmagRuvBdpRG98PsDmx6ZCsGQfVdsq8,27118
144
144
  sage/tests/book_stein_ent.py,sha256=3k1T56sB-csaLzJEsEyVJ9YaMBKtgc0W1_z7cuwiz-Y,19767
145
- sage/tests/book_stein_modform.py,sha256=tETTfZj787LI_ept4plgPGDPmZ8KJvWFI2OBa13K4WE,21236
145
+ sage/tests/book_stein_modform.py,sha256=zX0Y1OqrjXT5pEFSrhn6AwHkx43PhgpiLVh8lnPwKaM,21168
146
146
  sage/tests/cmdline.py,sha256=2JiDN3yvOjlHOYtcGHXBZa4y_qc3KGlR3vPTzShVxN8,26316
147
147
  sage/tests/combinatorial_hopf_algebras.py,sha256=FTzMq8JyyKLAU3vFacMZZAer7PxALQpg3SFdEjBdo_s,1849
148
148
  sage/tests/finite_poset.py,sha256=3lC1zEHE8_9uxsE0CPnZcgYsf8cFqfObYw7oAYfgFWI,26467
@@ -156,7 +156,7 @@ sage/tests/startup.py,sha256=G8Co8afXEC1FO9pyFlryBzLXXwY40_BcWrimaPadw3w,1185
156
156
  sage/tests/symbolic-series.py,sha256=5WlGSwW4eq-Ydev0jYtLDtuk1KCIJ7QCNE0IhZpc37Q,2991
157
157
  sage/tests/sympy.py,sha256=SGzxN4faL0Y3lokTYV_n_IYjf65pc1foBfLbxDhPDgk,431
158
158
  sage/tests/test_deprecation.py,sha256=Y2uvLozCshTPhQgfAxT_pAkkgX5Q16yJwQ0CleKHDJw,917
159
- passagemath_repl-10.5.17.dist-info/METADATA,sha256=U6o5Vhq6rN4gZHkXQiAeGtomUuvy7HyQK2H3ufJLv5E,3148
160
- passagemath_repl-10.5.17.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
161
- passagemath_repl-10.5.17.dist-info/top_level.txt,sha256=hibFyzQHiLOMK68qL1OWsNKaXOmSXqZjeLTBem6Yy7I,5
162
- passagemath_repl-10.5.17.dist-info/RECORD,,
159
+ passagemath_repl-10.5.19.dist-info/METADATA,sha256=WrOnYR2sW8ZS3-uSHf8R52BjvinGPxid0S0KywfhFjU,3148
160
+ passagemath_repl-10.5.19.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
161
+ passagemath_repl-10.5.19.dist-info/top_level.txt,sha256=hibFyzQHiLOMK68qL1OWsNKaXOmSXqZjeLTBem6Yy7I,5
162
+ passagemath_repl-10.5.19.dist-info/RECORD,,
sage/doctest/control.py CHANGED
@@ -1352,12 +1352,12 @@ class DocTestController(SageObject):
1352
1352
  opt = self.options
1353
1353
 
1354
1354
  if opt.gdb:
1355
- cmd = f'''exec gdb --eval-command="run" --args '''
1355
+ cmd = '''exec gdb --eval-command="run" --args '''
1356
1356
  flags = ""
1357
1357
  if opt.logfile:
1358
1358
  sage_cmd += f" --logfile {shlex.quote(opt.logfile)}"
1359
1359
  elif opt.lldb:
1360
- cmd = f'''exec lldb --one-line "process launch" --one-line "cont" -- '''
1360
+ cmd = '''exec lldb --one-line "process launch" --one-line "cont" -- '''
1361
1361
  flags = ""
1362
1362
  else:
1363
1363
  if opt.logfile is None:
sage/doctest/forker.py CHANGED
@@ -45,38 +45,48 @@ AUTHORS:
45
45
  # the License, or (at your option) any later version.
46
46
  # https://www.gnu.org/licenses/
47
47
  # ****************************************************************************
48
+ from __future__ import annotations
48
49
 
49
-
50
+ import doctest
51
+ import errno
52
+ import gc
53
+ import hashlib
54
+ import linecache
55
+ import multiprocessing
50
56
  import os
51
57
  import platform
58
+ import re
59
+ import signal
52
60
  import sys
61
+ import tempfile
53
62
  import time
54
- import signal
55
- import linecache
56
- import hashlib
57
- import multiprocessing
58
- import warnings
59
- import re
60
- import errno
61
- import doctest
62
63
  import traceback
63
- import tempfile
64
+ import typing
65
+ import warnings
64
66
  from collections import defaultdict
65
67
  from dis import findlinestarts
66
68
  from queue import Empty
67
- import gc
69
+
68
70
  import IPython.lib.pretty
69
71
 
70
- import sage.misc.randstate as randstate
71
- from sage.misc.timing import walltime
72
- from .util import Timer, RecordingDict, count_noun
73
- from .sources import DictAsObject
74
- from .parsing import OriginalSource, reduce_hex
75
- from sage.structure.sage_object import SageObject
76
- from .parsing import SageOutputChecker, pre_hash, get_source, unparse_optional_tags
77
- from sage.repl.user_globals import set_globals
78
72
  from sage.cpython.atexit import restore_atexit
79
73
  from sage.cpython.string import bytes_to_str, str_to_bytes
74
+ from sage.doctest.parsing import (
75
+ OriginalSource,
76
+ SageOutputChecker,
77
+ get_source,
78
+ pre_hash,
79
+ reduce_hex,
80
+ unparse_optional_tags,
81
+ )
82
+ from sage.doctest.sources import DictAsObject
83
+ from sage.doctest.util import RecordingDict, Timer, count_noun
84
+ from sage.misc import randstate
85
+ from sage.repl.user_globals import set_globals
86
+ from sage.structure.sage_object import SageObject
87
+
88
+ if typing.TYPE_CHECKING:
89
+ from sage.doctest.control import DocTestController
80
90
 
81
91
  # With OS X, Python 3.8 defaults to use 'spawn' instead of 'fork' in
82
92
  # multiprocessing, and Sage doctesting doesn't work with 'spawn'. See
@@ -113,7 +123,7 @@ def _sorted_dict_pprinter_factory(start, end):
113
123
  return inner
114
124
 
115
125
 
116
- def init_sage(controller=None):
126
+ def init_sage(controller: DocTestController | None = None) -> None:
117
127
  """
118
128
  Import the Sage library.
119
129
 
@@ -1714,7 +1724,7 @@ class DocTestDispatcher(SageObject):
1714
1724
  Create parallel :class:`DocTestWorker` processes and dispatches
1715
1725
  doctesting tasks.
1716
1726
  """
1717
- def __init__(self, controller):
1727
+ def __init__(self, controller: DocTestController):
1718
1728
  """
1719
1729
  INPUT:
1720
1730
 
sage/misc/cython.py CHANGED
@@ -25,6 +25,8 @@ import os
25
25
  import re
26
26
  import sys
27
27
  import shutil
28
+ import webbrowser
29
+ from pathlib import Path
28
30
 
29
31
  from sage.env import (SAGE_LOCAL, cython_aliases,
30
32
  sage_include_directories)
@@ -79,9 +81,16 @@ def _standard_libs_libdirs_incdirs_aliases():
79
81
  sequence_number = {}
80
82
 
81
83
 
84
+ def _webbrowser_open_file(path):
85
+ """
86
+ Open a html file in a web browser.
87
+ """
88
+ webbrowser.open(Path(path).as_uri())
89
+
90
+
82
91
  def cython(filename, verbose=0, compile_message=False,
83
- use_cache=False, create_local_c_file=False, annotate=True, sage_namespace=True,
84
- create_local_so_file=False):
92
+ use_cache=False, create_local_c_file=False, annotate=True, view_annotate=False,
93
+ view_annotate_callback=_webbrowser_open_file, sage_namespace=True, create_local_so_file=False):
85
94
  r"""
86
95
  Compile a Cython file. This converts a Cython file to a C (or C++ file),
87
96
  and then compiles that. The .c file and the .so file are
@@ -111,6 +120,14 @@ def cython(filename, verbose=0, compile_message=False,
111
120
  in the temporary directory, but if ``create_local_c_file`` is also True,
112
121
  then save a copy of the .html file in the current directory.
113
122
 
123
+ - ``view_annotate`` -- boolean (default: ``False``); if ``True``, open the
124
+ annotated html file in a web browser
125
+
126
+ - ``view_annotate_callback`` -- function; a function that takes a string
127
+ being the path to the html file. This can be overridden to change
128
+ what to do with the annotated html file. Have no effect unless
129
+ ``view_annotate`` is ``True``.
130
+
114
131
  - ``sage_namespace`` -- boolean (default: ``True``); if ``True``, import
115
132
  ``sage.all``
116
133
 
@@ -227,6 +244,34 @@ def cython(filename, verbose=0, compile_message=False,
227
244
  ....: from sage.misc.cachefunc cimport cache_key
228
245
  ....: ''')
229
246
 
247
+ Test ``view_annotate``::
248
+
249
+ sage: cython('''
250
+ ....: def f(int n):
251
+ ....: return n*n
252
+ ....: ''', view_annotate=True) # optional -- webbrowser
253
+
254
+ ::
255
+
256
+ sage: cython('''
257
+ ....: def f(int n):
258
+ ....: return n*n
259
+ ....: ''', view_annotate=True, annotate=False)
260
+ Traceback (most recent call last):
261
+ ...
262
+ ValueError: cannot view annotated file without creating it
263
+
264
+ ::
265
+
266
+ sage: collected_paths = []
267
+ sage: cython('''
268
+ ....: def f(int n):
269
+ ....: return n*n
270
+ ....: ''', view_annotate=True, view_annotate_callback=collected_paths.append)
271
+ sage: collected_paths
272
+ ['...']
273
+ sage: len(collected_paths)
274
+ 1
230
275
  """
231
276
  if not filename.endswith('pyx'):
232
277
  print("Warning: file (={}) should have extension .pyx".format(filename), file=sys.stderr)
@@ -382,6 +427,11 @@ def cython(filename, verbose=0, compile_message=False,
382
427
  shutil.copy(os.path.join(target_dir, name + ".html"),
383
428
  os.curdir)
384
429
 
430
+ if view_annotate:
431
+ if not annotate:
432
+ raise ValueError("cannot view annotated file without creating it")
433
+ view_annotate_callback(os.path.join(target_dir, name + ".html"))
434
+
385
435
  # This emulates running "setup.py build" with the correct options
386
436
  #
387
437
  # setuptools plugins considered harmful:
@@ -13,7 +13,7 @@ from sage.misc.temporary_file import tmp_dir
13
13
 
14
14
 
15
15
  def _import_module_from_path(name, path=None):
16
- """
16
+ r"""
17
17
  Import the module named ``name`` by searching the given path entries (or
18
18
  `sys.path` by default).
19
19
 
sage/misc/sagedoc.py CHANGED
@@ -694,7 +694,7 @@ def format(s, embedded=False):
694
694
  We check that the todo Sphinx extension is correctly activated::
695
695
 
696
696
  sage: sage.misc.sagedoc.format(sage.combinat.ranker.on_fly.__doc__) # needs sphinx
697
- " Return ... Todo: add tests as in combinat::rankers\n"
697
+ "...Return ...Todo: add tests as in combinat::rankers\n"
698
698
 
699
699
  In the following use case, the ``nodetex`` directive would have been ignored prior
700
700
  to :issue:`11815`::
@@ -1142,10 +1142,11 @@ def search_src(string, extra1='', extra2='', extra3='', extra4='',
1142
1142
  The following produces an error because the string 'fetch(' is a
1143
1143
  malformed regular expression::
1144
1144
 
1145
- sage: print(search_src(" fetch(", "def", interact=False))
1146
- Traceback (most recent call last):
1147
- ...
1148
- error: missing ), unterminated subpattern at position 6
1145
+ sage: try:
1146
+ ....: print(search_src(" fetch(", "def", interact=False))
1147
+ ....: except Exception as e:
1148
+ ....: print(e)
1149
+ missing ), unterminated subpattern at position 6
1149
1150
 
1150
1151
  To fix this, *escape* the parenthesis with a backslash::
1151
1152
 
@@ -1193,7 +1194,6 @@ def search_src(string, extra1='', extra2='', extra3='', extra4='',
1193
1194
  misc/sagedoc.py:... len(search_src("matrix", interact=False).splitlines())...
1194
1195
  misc/sagedoc.py:... len(search_src("matrix", module="sage.calculus", interact=False).splitlines())...
1195
1196
  misc/sagedoc.py:... len(search_src("matrix", path_re="calc"...
1196
- misc/sagedoc.py:... print(search_src(" fetch(", "def", interact=False))...
1197
1197
  misc/sagedoc.py:... print(search_src(r" fetch\(", "def", interact=False))...
1198
1198
  misc/sagedoc.py:... print(search_src(r" fetch\(", "def", "pyx", interact=False))...
1199
1199
  misc/sagedoc.py:... s = search_src('Matrix', path_re='matrix', interact=False); s.find('x') > 0...
@@ -1463,7 +1463,7 @@ class _sage_doc:
1463
1463
  sage: browse_sage_doc._open("reference", testing=True)[0] # needs sagemath_doc_html
1464
1464
  'http://localhost:8000/doc/live/reference/index.html'
1465
1465
  sage: browse_sage_doc(identity_matrix, 'rst')[-107:-47] # needs sage.modules
1466
- 'Full MatrixSpace of 3 by 3 sparse matrices over Integer Ring'
1466
+ '...Full MatrixSpace of 3 by 3 sparse matrices...'
1467
1467
  """
1468
1468
  def __init__(self):
1469
1469
  """
sage/repl/attach.py CHANGED
@@ -40,7 +40,7 @@ character-by-character::
40
40
  ....: traceback.print_exc(file=sys.stdout)
41
41
  Traceback (most recent call last):
42
42
  ...
43
- exec(preparse_file(f.read()) + "\n", globals)
43
+ exec(preparse_file(f.read()) + "\n", globals)...
44
44
  File "<string>", line 3, in <module>
45
45
  ValueError: third
46
46
  sage: detach(src)
@@ -52,7 +52,7 @@ character-by-character::
52
52
  ....: traceback.print_exc(file=sys.stdout)
53
53
  Traceback (most recent call last):
54
54
  ...
55
- exec(code, globals)
55
+ exec(code, globals)...
56
56
  File ".../foobar...sage.py", line ..., in <module>
57
57
  raise ValueError("third") # this should appear in the source snippet...
58
58
  ValueError: third
@@ -120,7 +120,7 @@ class SomeIPythonRepr(ObjectReprABC):
120
120
  self._type_repr = type_repr
121
121
 
122
122
  def __call__(self, obj, p, cycle):
123
- """
123
+ r"""
124
124
  Format object.
125
125
 
126
126
  INPUT:
@@ -142,7 +142,17 @@ class SomeIPythonRepr(ObjectReprABC):
142
142
  sage: pp = SomeIPythonRepr()
143
143
  sage: pp.format_string(set([1, 2, 3]))
144
144
  '{1, 2, 3}'
145
+
146
+ TESTS::
147
+
148
+ sage: pp.format_string(Sequence([[1]*20, [2]*20]))
149
+ '[[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]]'
145
150
  """
151
+ if hasattr(type(obj), '_repr_pretty_'):
152
+ # standard method for classes to extend pretty library
153
+ # see https://ipython.readthedocs.io/en/stable/api/generated/IPython.lib.pretty.html#extending
154
+ obj._repr_pretty_(p, cycle)
155
+ return True
146
156
  try:
147
157
  pretty_repr = self._type_repr[type(obj)]
148
158
  except KeyError:
@@ -218,7 +228,7 @@ class PlainPythonRepr(ObjectReprABC):
218
228
 
219
229
  def __call__(self, obj, p, cycle):
220
230
  r"""
221
- Format matrix.
231
+ Format object.
222
232
 
223
233
  INPUT:
224
234
 
sage/repl/image.py CHANGED
@@ -113,7 +113,7 @@ class Image(SageObject):
113
113
  sage: from sage.repl.image import Image
114
114
  sage: img = Image('RGB', (16, 16), 'white')
115
115
  sage: img.pil
116
- <PIL.Image.Image image mode=RGB size=16x16 at 0x...>
116
+ <PIL.Image.Image image mode=RGB size=16x16...>
117
117
  """
118
118
  return self._pil
119
119
 
@@ -65,6 +65,8 @@ In contrast, input to the ``%time`` magic command is preparsed::
65
65
  """
66
66
 
67
67
  from IPython.core.magic import Magics, magics_class, line_magic, cell_magic
68
+ from IPython.core.display import HTML
69
+ from IPython.core.getipython import get_ipython
68
70
 
69
71
  from sage.repl.load import load_wrap
70
72
  from sage.env import SAGE_IMPORTALL, SAGE_STARTUP_FILE
@@ -72,6 +74,14 @@ from sage.misc.lazy_import import LazyImport
72
74
  from sage.misc.misc import run_once
73
75
 
74
76
 
77
+ def _running_in_notebook():
78
+ try:
79
+ from ipykernel.zmqshell import ZMQInteractiveShell
80
+ except ImportError:
81
+ return False
82
+ return isinstance(get_ipython(), ZMQInteractiveShell)
83
+
84
+
75
85
  @magics_class
76
86
  class SageMagics(Magics):
77
87
 
@@ -348,6 +358,12 @@ class SageMagics(Magics):
348
358
  This is syntactic sugar on the
349
359
  :func:`~sage.misc.cython.cython_compile` function.
350
360
 
361
+ Note that there is also the ``%%cython`` cell magic provided by Cython,
362
+ which can be loaded with ``%load_ext cython``, see
363
+ `Cython documentation <https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#compiling-with-a-jupyter-notebook>`_
364
+ for more details.
365
+ The semantic is slightly different from the version provided by Sage.
366
+
351
367
  INPUT:
352
368
 
353
369
  - ``line`` -- parsed as keyword arguments. The allowed arguments are:
@@ -357,12 +373,20 @@ class SageMagics(Magics):
357
373
  - ``--use-cache``
358
374
  - ``--create-local-c-file``
359
375
  - ``--annotate``
376
+ - ``--view-annotate``
360
377
  - ``--sage-namespace``
361
378
  - ``--create-local-so-file``
362
379
  - ``--no-compile-message``, ``--no-use-cache``, etc.
363
380
 
364
381
  See :func:`~sage.misc.cython.cython` for details.
365
382
 
383
+ If ``--view-annotate`` is given, the annotation is either displayed
384
+ inline in the Sage notebook or opened in a new web browser, depending
385
+ on whether the Sage notebook is used.
386
+
387
+ You can override the selection by specifying
388
+ ``--view-annotate=webbrowser`` or ``--view-annotate=displayhtml``.
389
+
366
390
  - ``cell`` -- string; the Cython source code to process
367
391
 
368
392
  OUTPUT: none; the Cython code is compiled and loaded
@@ -403,6 +427,45 @@ class SageMagics(Magics):
403
427
  ....: ''')
404
428
  UsageError: unrecognized arguments: --help
405
429
 
430
+ Test ``--view-annotate`` invalid arguments::
431
+
432
+ sage: # needs sage.misc.cython
433
+ sage: shell.run_cell('''
434
+ ....: %%cython --view-annotate=xx
435
+ ....: print(1)
436
+ ....: ''')
437
+ UsageError: argument --view-annotate: invalid choice: 'xx' (choose from 'none', 'auto', 'webbrowser', 'displayhtml')
438
+
439
+ Test ``--view-annotate=displayhtml`` (note that in a notebook environment
440
+ an inline HTML frame will be displayed)::
441
+
442
+ sage: # needs sage.misc.cython
443
+ sage: shell.run_cell('''
444
+ ....: %%cython --view-annotate=displayhtml
445
+ ....: print(1)
446
+ ....: ''')
447
+ 1
448
+ <IPython.core.display.HTML object>
449
+
450
+ Test ``--view-annotate=webbrowser``::
451
+
452
+ sage: # needs sage.misc.cython webbrowser
453
+ sage: shell.run_cell('''
454
+ ....: %%cython --view-annotate
455
+ ....: print(1)
456
+ ....: ''')
457
+ 1
458
+ sage: shell.run_cell('''
459
+ ....: %%cython --view-annotate=auto
460
+ ....: print(1)
461
+ ....: ''') # --view-annotate=auto is undocumented feature, equivalent to --view-annotate
462
+ 1
463
+ sage: shell.run_cell('''
464
+ ....: %%cython --view-annotate=webbrowser
465
+ ....: print(1)
466
+ ....: ''')
467
+ 1
468
+
406
469
  Test invalid quotes::
407
470
 
408
471
  sage: # needs sage.misc.cython
@@ -434,10 +497,26 @@ class SageMagics(Magics):
434
497
  parser.add_argument("--use-cache", action=argparse.BooleanOptionalAction)
435
498
  parser.add_argument("--create-local-c-file", action=argparse.BooleanOptionalAction)
436
499
  parser.add_argument("--annotate", action=argparse.BooleanOptionalAction)
500
+ parser.add_argument("--view-annotate", choices=["none", "auto", "webbrowser", "displayhtml"],
501
+ nargs="?", const="auto", default="none")
437
502
  parser.add_argument("--sage-namespace", action=argparse.BooleanOptionalAction)
438
503
  parser.add_argument("--create-local-so-file", action=argparse.BooleanOptionalAction)
439
504
  args = parser.parse_args(shlex.split(line))
440
- return cython_compile(cell, **{k: v for k, v in args.__dict__.items() if v is not None})
505
+ view_annotate = args.view_annotate
506
+ del args.view_annotate
507
+ if view_annotate == "auto":
508
+ if _running_in_notebook():
509
+ view_annotate = "displayhtml"
510
+ else:
511
+ view_annotate = "webbrowser"
512
+ args_dict = {k: v for k, v in args.__dict__.items() if v is not None}
513
+ if view_annotate != "none":
514
+ args_dict["view_annotate"] = True
515
+ if view_annotate == "displayhtml":
516
+ path_to_annotate_html_container = []
517
+ cython_compile(cell, **args_dict, view_annotate_callback=path_to_annotate_html_container.append)
518
+ return HTML(filename=path_to_annotate_html_container[0])
519
+ return cython_compile(cell, **args_dict)
441
520
 
442
521
  @cell_magic
443
522
  def fortran(self, line, cell):
@@ -510,7 +589,7 @@ class SageCustomizations:
510
589
  self.init_line_transforms()
511
590
 
512
591
  try:
513
- import sage.all # until sage's import hell is fixed
592
+ import sage.all # until sage's import hell is fixed
514
593
  except ImportError:
515
594
  import sage.all__sagemath_repl
516
595
 
sage/repl/preparse.py CHANGED
@@ -1706,7 +1706,7 @@ def preparse(line, reset=True, do_time=False, ignore_prompts=False,
1706
1706
  "ZZ = ZZ['u,v']; (x, y,) = ZZ._first_ngens(2)"
1707
1707
  sage: preparse("ZZ.<x> = QQ[2^(1/3)]")
1708
1708
  'ZZ = QQ[Integer(2)**(Integer(1)/Integer(3))]; (x,) = ZZ._first_ngens(1)'
1709
- sage: QQ[2^(1/3)] # needs sage.rings.number_field sage.symbolic
1709
+ sage: QQ[2^(1/3)] # needs fpylll sage.rings.number_field sage.symbolic
1710
1710
  Number Field in a with defining polynomial x^3 - 2 with a = 1.259921049894873?
1711
1711
 
1712
1712
  sage: preparse("a^b")
@@ -32,18 +32,26 @@ EXAMPLES::
32
32
  # the License, or (at your option) any later version.
33
33
  # https://www.gnu.org/licenses/
34
34
  # ****************************************************************************
35
-
35
+ from __future__ import annotations
36
36
 
37
37
  import warnings
38
+ from typing import Any
39
+
40
+ try:
41
+ from typing import Self # type: ignore (Python >= 3.11)
42
+ except ImportError:
43
+ from typing_extensions import Self # type: ignore (Python 3.9, 3.10)
38
44
 
39
- from sage.structure.sage_object import SageObject
40
45
  from sage.repl.rich_output.output_basic import (
41
- OutputPlainText, OutputAsciiArt, OutputUnicodeArt, OutputLatex,
46
+ OutputAsciiArt,
47
+ OutputPlainText,
48
+ OutputUnicodeArt,
42
49
  )
43
50
  from sage.repl.rich_output.output_browser import (
44
51
  OutputHtml,
45
52
  )
46
53
  from sage.repl.rich_output.preferences import DisplayPreferences
54
+ from sage.structure.sage_object import SageObject
47
55
 
48
56
 
49
57
  class DisplayException(Exception):
@@ -185,7 +193,7 @@ class restricted_output:
185
193
 
186
194
  class DisplayManager(SageObject):
187
195
 
188
- _instance = None
196
+ _instance: Self | None = None
189
197
 
190
198
  def __init__(self):
191
199
  """
@@ -205,7 +213,7 @@ class DisplayManager(SageObject):
205
213
  self.switch_backend(BackendSimple())
206
214
 
207
215
  @classmethod
208
- def get_instance(cls):
216
+ def get_instance(cls) -> Self:
209
217
  """
210
218
  Get the singleton instance.
211
219
 
@@ -771,7 +779,7 @@ class DisplayManager(SageObject):
771
779
  """
772
780
  return self._supported_output
773
781
 
774
- def displayhook(self, obj):
782
+ def displayhook(self, obj: Any) -> None | Any:
775
783
  """
776
784
  Implementation of the displayhook.
777
785
 
@@ -160,7 +160,7 @@ class SequencePrettyPrinter(SageObject):
160
160
  sage: seq._concatenate_graphs().show(edge_labels=True) # needs sage.graphs sage.plot
161
161
  Traceback (most recent call last):
162
162
  ...
163
- TypeError: ...matplotlib() got an unexpected keyword argument 'edge_labels'
163
+ TypeError: ...matplotlib() got an unexpected keyword argument 'edge_labels'...
164
164
  """
165
165
  try:
166
166
  from sage.plot.plot import Graphics
sage/repl/user_globals.py CHANGED
@@ -102,7 +102,7 @@ def get_globals():
102
102
  return user_globals
103
103
 
104
104
 
105
- def set_globals(g):
105
+ def set_globals(g: dict) -> None:
106
106
  """
107
107
  Set the dictionary of all user globals to ``g``.
108
108
 
@@ -26,7 +26,7 @@ points since they cannot create any sort of crossing. ::
26
26
  sage: dcrossing([(1,5), (2,4), (4,9), (6,12), (7,10), (10,11)])
27
27
  3
28
28
  """
29
- #*****************************************************************************
29
+ # ****************************************************************************
30
30
  # Copyright (C) 2008 Dan Drake <ddrake@member.ams.org>
31
31
  #
32
32
  # This program is free software: you can redistribute it and/or modify
@@ -35,8 +35,8 @@ points since they cannot create any sort of crossing. ::
35
35
  # your option) any later version.
36
36
  #
37
37
  # See https://www.gnu.org/licenses/.
38
- #*****************************************************************************
39
- from sage.combinat.set_partition import SetPartitions as SetPartitions
38
+ # ****************************************************************************
39
+ from sage.combinat.set_partition import SetPartitions
40
40
 
41
41
 
42
42
  def CompleteMatchings(n):
@@ -34,11 +34,9 @@ TESTS::
34
34
  sage: E6^4
35
35
  1/64524128256 - 1/32006016*q + 241/10668672*q^2 + O(q^3)
36
36
  sage: victor_miller_basis(28,5)
37
- [
38
- 1 + 15590400*q^3 + 36957286800*q^4 + O(q^5),
39
- q + 151740*q^3 + 61032448*q^4 + O(q^5),
40
- q^2 + 192*q^3 - 8280*q^4 + O(q^5)
41
- ]
37
+ [1 + 15590400*q^3 + 36957286800*q^4 + O(q^5),
38
+ q + 151740*q^3 + 61032448*q^4 + O(q^5),
39
+ q^2 + 192*q^3 - 8280*q^4 + O(q^5)]
42
40
  sage: R.<q> = QQ[['q']]
43
41
  sage: F4 = 240 * eisenstein_series_qexp(4,3)
44
42
  sage: F6 = -504 * eisenstein_series_qexp(6,3)
@@ -50,12 +48,10 @@ TESTS::
50
48
  1 + 196560*q^2 + O(q^3)
51
49
  sage: M = ModularForms(1,36, prec=6).echelon_form()
52
50
  sage: M.basis()
53
- [
54
- 1 + 6218175600*q^4 + 15281788354560*q^5 + O(q^6),
55
- q + 57093088*q^4 + 37927345230*q^5 + O(q^6),
56
- q^2 + 194184*q^4 + 7442432*q^5 + O(q^6),
57
- q^3 - 72*q^4 + 2484*q^5 + O(q^6)
58
- ]
51
+ [1 + 6218175600*q^4 + 15281788354560*q^5 + O(q^6),
52
+ q + 57093088*q^4 + 37927345230*q^5 + O(q^6),
53
+ q^2 + 194184*q^4 + 7442432*q^5 + O(q^6),
54
+ q^3 - 72*q^4 + 2484*q^5 + O(q^6)]
59
55
  sage: T2 = M.hecke_matrix(2); T2
60
56
  [ 34359738369 0 6218175600 9026867482214400]
61
57
  [ 0 0 34416831456 5681332472832]
@@ -196,11 +192,9 @@ TESTS::
196
192
  (x - 2)^2 * (x - 6)^3 * (x^2 - 8)^2
197
193
  sage: M = ModularSymbols(39, 2)
198
194
  sage: M.T(2).decomposition()
199
- [
200
- Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 9 for Gamma_0(39) of weight 2 with sign 0 over Rational Field,
201
- Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 9 for Gamma_0(39) of weight 2 with sign 0 over Rational Field,
202
- Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 9 for Gamma_0(39) of weight 2 with sign 0 over Rational Field
203
- ]
195
+ [Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 9 for Gamma_0(39) of weight 2 with sign 0 over Rational Field,
196
+ Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 9 for Gamma_0(39) of weight 2 with sign 0 over Rational Field,
197
+ Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 9 for Gamma_0(39) of weight 2 with sign 0 over Rational Field]
204
198
  sage: M = ModularSymbols(2, 2)
205
199
  sage: M.boundary_map()
206
200
  Hecke module morphism boundary map defined by the matrix
@@ -290,10 +284,7 @@ TESTS::
290
284
  sage: f(1,0)
291
285
  -1/3*q^2 + 2/3*q^3 + 1/3*q^4 - 2/3*q^5 + O(q^6)
292
286
  sage: S.q_expansion_basis(6)
293
- [
294
- q - q^3 - q^4 + O(q^6),
295
- q^2 - 2*q^3 - q^4 + 2*q^5 + O(q^6)
296
- ]
287
+ [q - q^3 - q^4 + O(q^6), q^2 - 2*q^3 - q^4 + 2*q^5 + O(q^6)]
297
288
  sage: R = Integers(49)
298
289
  sage: R
299
290
  Ring of integers modulo 49
@@ -342,16 +333,14 @@ TESTS::
342
333
  1
343
334
  sage: G = DirichletGroup(20)
344
335
  sage: G.galois_orbits()
345
- [
346
- [Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> -1],
347
- [Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> -zeta4,
348
- Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> zeta4],
349
- [Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1],
350
- [Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -1],
351
- [Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -zeta4,
352
- Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> zeta4],
353
- [Dirichlet character modulo 20 of conductor 1 mapping 11 |--> 1, 17 |--> 1]
354
- ]
336
+ [[Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> -1],
337
+ [Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> -zeta4,
338
+ Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> zeta4],
339
+ [Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1],
340
+ [Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -1],
341
+ [Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -zeta4,
342
+ Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> zeta4],
343
+ [Dirichlet character modulo 20 of conductor 1 mapping 11 |--> 1, 17 |--> 1]]
355
344
  sage: G = DirichletGroup(11, QQ); G
356
345
  Group of Dirichlet characters modulo 11 with values in Rational Field
357
346
  sage: list(G)
@@ -423,19 +412,17 @@ TESTS::
423
412
  -108846/5*zeta4 - 176868/5
424
413
  sage: E = EisensteinForms(Gamma1(13),2)
425
414
  sage: E.eisenstein_series()
426
- [
427
- 1/2 + q + 3*q^2 + 4*q^3 + 7*q^4 + 6*q^5 + O(q^6),
428
- -7/13*zeta6 - 11/13 + q + (2*zeta6 + 1)*q^2 + (-3*zeta6 + 1)*q^3 + (6*zeta6 - 3)*q^4 - 4*q^5 + O(q^6),
429
- q + (zeta6 + 2)*q^2 + (-zeta6 + 3)*q^3 + (3*zeta6 + 3)*q^4 + 4*q^5 + O(q^6),
430
- -zeta6 + q + (2*zeta6 - 1)*q^2 + (3*zeta6 - 2)*q^3 + (-2*zeta6 - 1)*q^4 + 6*q^5 + O(q^6),
431
- q + (zeta6 + 1)*q^2 + (zeta6 + 2)*q^3 + (zeta6 + 2)*q^4 + 6*q^5 + O(q^6),
432
- -1 + q - q^2 + 4*q^3 + 3*q^4 - 4*q^5 + O(q^6),
433
- q + q^2 + 4*q^3 + 3*q^4 + 4*q^5 + O(q^6),
434
- zeta6 - 1 + q + (-2*zeta6 + 1)*q^2 + (-3*zeta6 + 1)*q^3 + (2*zeta6 - 3)*q^4 + 6*q^5 + O(q^6),
435
- q + (-zeta6 + 2)*q^2 + (-zeta6 + 3)*q^3 + (-zeta6 + 3)*q^4 + 6*q^5 + O(q^6),
436
- 7/13*zeta6 - 18/13 + q + (-2*zeta6 + 3)*q^2 + (3*zeta6 - 2)*q^3 + (-6*zeta6 + 3)*q^4 - 4*q^5 + O(q^6),
437
- q + (-zeta6 + 3)*q^2 + (zeta6 + 2)*q^3 + (-3*zeta6 + 6)*q^4 + 4*q^5 + O(q^6)
438
- ]
415
+ [1/2 + q + 3*q^2 + 4*q^3 + 7*q^4 + 6*q^5 + O(q^6),
416
+ -7/13*zeta6 - 11/13 + q + (2*zeta6 + 1)*q^2 + (-3*zeta6 + 1)*q^3 + (6*zeta6 - 3)*q^4 - 4*q^5 + O(q^6),
417
+ q + (zeta6 + 2)*q^2 + (-zeta6 + 3)*q^3 + (3*zeta6 + 3)*q^4 + 4*q^5 + O(q^6),
418
+ -zeta6 + q + (2*zeta6 - 1)*q^2 + (3*zeta6 - 2)*q^3 + (-2*zeta6 - 1)*q^4 + 6*q^5 + O(q^6),
419
+ q + (zeta6 + 1)*q^2 + (zeta6 + 2)*q^3 + (zeta6 + 2)*q^4 + 6*q^5 + O(q^6),
420
+ -1 + q - q^2 + 4*q^3 + 3*q^4 - 4*q^5 + O(q^6),
421
+ q + q^2 + 4*q^3 + 3*q^4 + 4*q^5 + O(q^6),
422
+ zeta6 - 1 + q + (-2*zeta6 + 1)*q^2 + (-3*zeta6 + 1)*q^3 + (2*zeta6 - 3)*q^4 + 6*q^5 + O(q^6),
423
+ q + (-zeta6 + 2)*q^2 + (-zeta6 + 3)*q^3 + (-zeta6 + 3)*q^4 + 6*q^5 + O(q^6),
424
+ 7/13*zeta6 - 18/13 + q + (-2*zeta6 + 3)*q^2 + (3*zeta6 - 2)*q^3 + (-6*zeta6 + 3)*q^4 - 4*q^5 + O(q^6),
425
+ q + (-zeta6 + 3)*q^2 + (zeta6 + 2)*q^3 + (-3*zeta6 + 6)*q^4 + 4*q^5 + O(q^6)]
439
426
  sage: e = E.eisenstein_series()
440
427
  sage: for e in E.eisenstein_series():
441
428
  ....: print(e.parameters())
@@ -538,21 +525,15 @@ TESTS::
538
525
  of dimension 10 for Congruence Subgroup Gamma0(45) of
539
526
  weight 2 over Rational Field
540
527
  sage: S.basis()
541
- [
542
- q - q^4 - q^10 - 2*q^13 + O(q^14),
543
- q^2 - q^5 - 3*q^8 + 4*q^11 + O(q^14),
544
- q^3 - q^6 - q^9 - q^12 + O(q^14)
545
- ]
528
+ [q - q^4 - q^10 - 2*q^13 + O(q^14),
529
+ q^2 - q^5 - 3*q^8 + 4*q^11 + O(q^14),
530
+ q^3 - q^6 - q^9 - q^12 + O(q^14)]
546
531
  sage: S.new_subspace().basis()
547
- [
548
- q + q^2 - q^4 - q^5 - 3*q^8 - q^10 + 4*q^11 - 2*q^13 + O(q^14)
549
- ]
532
+ [q + q^2 - q^4 - q^5 - 3*q^8 - q^10 + 4*q^11 - 2*q^13 + O(q^14)]
550
533
  sage: CuspForms(Gamma0(9),2)
551
534
  Cuspidal subspace of dimension 0 of Modular Forms space
552
535
  of dimension 3 for Congruence Subgroup Gamma0(9) of
553
536
  weight 2 over Rational Field
554
537
  sage: CuspForms(Gamma0(15),2, prec=10).basis()
555
- [
556
- q - q^2 - q^3 - q^4 + q^5 + q^6 + 3*q^8 + q^9 + O(q^10)
557
- ]
538
+ [q - q^2 - q^3 - q^4 + q^5 + q^6 + 3*q^8 + q^9 + O(q^10)]
558
539
  """