ipython 9.15.0__tar.gz → 9.16.0__tar.gz

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 (520) hide show
  1. {ipython-9.15.0 → ipython-9.16.0}/.mailmap +2 -3
  2. {ipython-9.15.0 → ipython-9.16.0}/.pre-commit-config.yaml +5 -3
  3. {ipython-9.15.0 → ipython-9.16.0}/COPYING.rst +2 -2
  4. {ipython-9.15.0 → ipython-9.16.0}/IPython/__init__.py +10 -26
  5. {ipython-9.15.0 → ipython-9.16.0}/IPython/__main__.py +0 -1
  6. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/alias.py +9 -11
  7. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/application.py +18 -20
  8. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/async_helpers.py +2 -2
  9. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/autocall.py +7 -7
  10. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/builtin_trap.py +20 -14
  11. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/compilerop.py +15 -11
  12. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/completer.py +120 -119
  13. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/completerlib.py +5 -8
  14. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/crashhandler.py +15 -11
  15. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/debugger.py +78 -32
  16. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/debugger_backport.py +1 -1
  17. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/display.py +72 -79
  18. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/display_functions.py +1 -2
  19. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/display_trap.py +2 -4
  20. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/displayhook.py +2 -3
  21. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/displaypub.py +3 -4
  22. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/doctb.py +16 -13
  23. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/error.py +0 -1
  24. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/events.py +7 -6
  25. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/extensions.py +1 -2
  26. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/formatters.py +26 -27
  27. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/getipython.py +11 -7
  28. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/guarded_eval.py +29 -23
  29. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/history.py +168 -92
  30. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/historyapp.py +0 -1
  31. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/hooks.py +11 -6
  32. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/inputtransformer2.py +207 -161
  33. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/interactiveshell.py +109 -81
  34. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/kitty.py +2 -2
  35. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/latex_symbols.py +0 -2
  36. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/logger.py +29 -25
  37. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/macro.py +13 -18
  38. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magic.py +24 -23
  39. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magic_arguments.py +5 -6
  40. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/ast_mod.py +4 -6
  41. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/auto.py +2 -1
  42. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/basic.py +28 -8
  43. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/code.py +24 -22
  44. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/config.py +4 -4
  45. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/execution.py +20 -32
  46. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/extension.py +3 -3
  47. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/history.py +4 -4
  48. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/logging.py +6 -6
  49. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/namespace.py +9 -9
  50. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/osm.py +12 -12
  51. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/script.py +61 -24
  52. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/oinspect.py +39 -63
  53. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/page.py +19 -22
  54. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/payload.py +0 -1
  55. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/prefilter.py +13 -14
  56. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/profileapp.py +12 -13
  57. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/profiledir.py +13 -19
  58. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/pylabtools.py +7 -21
  59. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/release.py +1 -2
  60. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/shellapp.py +19 -18
  61. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/splitinput.py +2 -3
  62. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/tbtools.py +39 -35
  63. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/tips.py +2 -1
  64. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/ultratb.py +34 -32
  65. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/usage.py +17 -18
  66. {ipython-9.15.0 → ipython-9.16.0}/IPython/extensions/__init__.py +0 -1
  67. {ipython-9.15.0 → ipython-9.16.0}/IPython/extensions/autoreload.py +8 -12
  68. {ipython-9.15.0 → ipython-9.16.0}/IPython/extensions/deduperreload/deduperreload.py +6 -4
  69. {ipython-9.15.0 → ipython-9.16.0}/IPython/extensions/deduperreload/deduperreload_patching.py +0 -1
  70. {ipython-9.15.0 → ipython-9.16.0}/IPython/extensions/storemagic.py +7 -9
  71. ipython-9.16.0/IPython/extensions/tests/test_deduperreload.py +2310 -0
  72. {ipython-9.15.0 → ipython-9.16.0}/IPython/external/__init__.py +1 -3
  73. {ipython-9.15.0 → ipython-9.16.0}/IPython/external/pickleshare.py +4 -11
  74. {ipython-9.15.0 → ipython-9.16.0}/IPython/external/qt_loaders.py +1 -1
  75. {ipython-9.15.0 → ipython-9.16.0}/IPython/lib/__init__.py +0 -1
  76. {ipython-9.15.0 → ipython-9.16.0}/IPython/lib/backgroundjobs.py +20 -21
  77. {ipython-9.15.0 → ipython-9.16.0}/IPython/lib/clipboard.py +8 -7
  78. {ipython-9.15.0 → ipython-9.16.0}/IPython/lib/deepreload.py +3 -4
  79. {ipython-9.15.0 → ipython-9.16.0}/IPython/lib/demo.py +4 -5
  80. {ipython-9.15.0 → ipython-9.16.0}/IPython/lib/display.py +41 -30
  81. {ipython-9.15.0 → ipython-9.16.0}/IPython/lib/editorhooks.py +23 -24
  82. {ipython-9.15.0 → ipython-9.16.0}/IPython/lib/guisupport.py +0 -1
  83. {ipython-9.15.0 → ipython-9.16.0}/IPython/lib/latextools.py +8 -11
  84. {ipython-9.15.0 → ipython-9.16.0}/IPython/lib/lexers.py +0 -1
  85. {ipython-9.15.0 → ipython-9.16.0}/IPython/lib/pretty.py +4 -9
  86. {ipython-9.15.0 → ipython-9.16.0}/IPython/paths.py +8 -7
  87. {ipython-9.15.0 → ipython-9.16.0}/IPython/sphinxext/custom_doctests.py +5 -5
  88. {ipython-9.15.0 → ipython-9.16.0}/IPython/sphinxext/ipython_directive.py +19 -19
  89. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/debugger.py +29 -29
  90. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/embed.py +83 -25
  91. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/interactiveshell.py +11 -14
  92. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/ipapp.py +11 -10
  93. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/magics.py +3 -4
  94. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/prompts.py +7 -6
  95. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/pt_inputhooks/__init__.py +1 -2
  96. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/pt_inputhooks/osx.py +0 -1
  97. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/pt_inputhooks/qt.py +1 -1
  98. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/ptutils.py +5 -1
  99. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/shortcuts/__init__.py +4 -4
  100. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/shortcuts/auto_suggest.py +14 -10
  101. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/shortcuts/filters.py +5 -6
  102. ipython-9.16.0/IPython/terminal/tests/test_ptutils.py +86 -0
  103. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/decorators.py +2 -3
  104. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/globalipapp.py +1 -1
  105. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/ipunittest.py +5 -5
  106. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/plugin/dtexample.py +2 -2
  107. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/plugin/ipdoctest.py +1 -1
  108. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/plugin/pytest_ipdoctest.py +43 -52
  109. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/plugin/test_ipdoctest.py +5 -5
  110. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/plugin/test_refs.py +0 -1
  111. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/skipdoctest.py +2 -0
  112. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/tools.py +13 -14
  113. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/PyColorize.py +7 -4
  114. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/_process_common.py +7 -7
  115. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/_process_posix.py +3 -3
  116. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/_process_win32.py +9 -16
  117. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/_sysinfo.py +1 -1
  118. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/capture.py +7 -7
  119. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/contexts.py +0 -2
  120. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/data.py +1 -1
  121. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/decorators.py +0 -1
  122. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/dir2.py +3 -3
  123. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/encoding.py +1 -2
  124. ipython-9.16.0/IPython/utils/frame.py +31 -0
  125. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/generics.py +0 -1
  126. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/importstring.py +1 -1
  127. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/io.py +3 -8
  128. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/ipstruct.py +1 -2
  129. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/module_paths.py +3 -2
  130. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/openpy.py +4 -4
  131. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/path.py +17 -10
  132. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/process.py +0 -3
  133. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/sentinel.py +1 -0
  134. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/strdispatch.py +2 -2
  135. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/sysinfo.py +2 -2
  136. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/syspathcontext.py +0 -1
  137. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/tempdir.py +6 -5
  138. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/terminal.py +2 -2
  139. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/text.py +27 -78
  140. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/timing.py +3 -4
  141. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/tokenutil.py +4 -3
  142. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/wildcard.py +3 -4
  143. {ipython-9.15.0 → ipython-9.16.0}/MANIFEST.in +1 -0
  144. {ipython-9.15.0/ipython.egg-info → ipython-9.16.0}/PKG-INFO +2 -4
  145. {ipython-9.15.0 → ipython-9.16.0}/README.rst +1 -1
  146. ipython-9.16.0/conftest.py +28 -0
  147. {ipython-9.15.0 → ipython-9.16.0}/docs/Makefile +7 -28
  148. {ipython-9.15.0 → ipython-9.16.0}/docs/README.rst +7 -7
  149. {ipython-9.15.0 → ipython-9.16.0}/docs/autogen_api.py +8 -8
  150. {ipython-9.15.0 → ipython-9.16.0}/docs/autogen_config.py +5 -1
  151. ipython-9.16.0/docs/autogen_magics.py +73 -0
  152. {ipython-9.15.0 → ipython-9.16.0}/docs/autogen_shortcuts.py +19 -13
  153. {ipython-9.15.0 → ipython-9.16.0}/docs/make.cmd +3 -7
  154. ipython-9.16.0/docs/modernization_triage_2026-07.md +46 -0
  155. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_templates/breadcrumbs.html +1 -1
  156. {ipython-9.15.0 → ipython-9.16.0}/docs/source/about/history.rst +1 -2
  157. {ipython-9.15.0 → ipython-9.16.0}/docs/source/about/index.rst +0 -1
  158. {ipython-9.15.0 → ipython-9.16.0}/docs/source/about/license_and_copyright.rst +87 -84
  159. {ipython-9.15.0 → ipython-9.16.0}/docs/source/conf.py +3 -16
  160. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/callbacks.rst +8 -5
  161. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/custommagics.rst +6 -8
  162. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/details.rst +19 -19
  163. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/eventloops.rst +21 -42
  164. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/extensions/index.rst +8 -6
  165. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/inputtransforms.rst +4 -4
  166. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/integrating.rst +4 -2
  167. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/intro.rst +10 -10
  168. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/shell_mimerenderer.rst +2 -2
  169. {ipython-9.15.0 → ipython-9.16.0}/docs/source/coredev/index.rst +9 -13
  170. {ipython-9.15.0 → ipython-9.16.0}/docs/source/development/config.rst +13 -14
  171. {ipython-9.15.0 → ipython-9.16.0}/docs/source/development/execution.rst +10 -20
  172. {ipython-9.15.0 → ipython-9.16.0}/docs/source/development/how_ipython_works.rst +7 -7
  173. {ipython-9.15.0 → ipython-9.16.0}/docs/source/development/index.rst +0 -1
  174. {ipython-9.15.0 → ipython-9.16.0}/docs/source/development/wrapperkernels.rst +26 -25
  175. {ipython-9.15.0 → ipython-9.16.0}/docs/source/index.rst +7 -8
  176. {ipython-9.15.0 → ipython-9.16.0}/docs/source/install/index.rst +5 -7
  177. {ipython-9.15.0 → ipython-9.16.0}/docs/source/install/install.rst +3 -3
  178. {ipython-9.15.0 → ipython-9.16.0}/docs/source/interactive/autoawait.rst +17 -15
  179. {ipython-9.15.0 → ipython-9.16.0}/docs/source/interactive/index.rst +1 -1
  180. {ipython-9.15.0 → ipython-9.16.0}/docs/source/interactive/magics.rst +2 -2
  181. {ipython-9.15.0 → ipython-9.16.0}/docs/source/interactive/plotting.rst +1 -1
  182. {ipython-9.15.0 → ipython-9.16.0}/docs/source/interactive/reference.rst +17 -14
  183. {ipython-9.15.0 → ipython-9.16.0}/docs/source/interactive/shell.rst +0 -1
  184. {ipython-9.15.0 → ipython-9.16.0}/docs/source/interactive/tips.rst +2 -5
  185. {ipython-9.15.0 → ipython-9.16.0}/docs/source/interactive/tutorial.rst +9 -9
  186. {ipython-9.15.0 → ipython-9.16.0}/docs/source/links.txt +2 -3
  187. {ipython-9.15.0 → ipython-9.16.0}/docs/source/overview.rst +7 -7
  188. ipython-9.16.0/docs/source/sphinx.toml +41 -0
  189. {ipython-9.15.0 → ipython-9.16.0}/docs/source/sphinxext.rst +2 -3
  190. ipython-9.16.0/docs/source/whatsnew/development.rst +26 -0
  191. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/github-stats-0.11.rst +6 -6
  192. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/github-stats-0.12.rst +4 -4
  193. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/github-stats-0.13.rst +9 -9
  194. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/github-stats-1.0.rst +36 -36
  195. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/github-stats-2.0.rst +25 -25
  196. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version0.10.rst +6 -7
  197. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version0.11.rst +7 -7
  198. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version0.12.rst +6 -6
  199. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version0.13.rst +46 -46
  200. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version0.8.rst +5 -6
  201. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version0.9.rst +25 -26
  202. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version1.0.rst +2 -3
  203. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version3.rst +3 -3
  204. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version3_widget_migration.rst +1 -1
  205. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version4.rst +0 -1
  206. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version5.rst +3 -3
  207. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version6.rst +4 -4
  208. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version7.rst +12 -12
  209. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version8.rst +1 -1
  210. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version9.rst +205 -18
  211. {ipython-9.15.0 → ipython-9.16.0}/docs/sphinxext/apigen.py +8 -8
  212. {ipython-9.15.0 → ipython-9.16.0}/examples/Embedding/embed_class_long.py +2 -2
  213. {ipython-9.15.0 → ipython-9.16.0}/examples/Embedding/start_ipython_config.py +1 -1
  214. {ipython-9.15.0 → ipython-9.16.0}/examples/utils/list_pyfiles.ipy +1 -1
  215. {ipython-9.15.0 → ipython-9.16.0}/examples/utils/list_subdirs.ipy +1 -1
  216. {ipython-9.15.0 → ipython-9.16.0/ipython.egg-info}/PKG-INFO +2 -4
  217. {ipython-9.15.0 → ipython-9.16.0}/ipython.egg-info/SOURCES.txt +35 -8
  218. {ipython-9.15.0 → ipython-9.16.0}/ipython.egg-info/requires.txt +1 -3
  219. {ipython-9.15.0 → ipython-9.16.0}/pyproject.toml +145 -75
  220. ipython-9.16.0/setup.cfg +4 -0
  221. {ipython-9.15.0 → ipython-9.16.0}/setup.py +2 -17
  222. {ipython-9.15.0 → ipython-9.16.0}/setupbase.py +1 -1
  223. ipython-9.16.0/tests/__init__.py +0 -0
  224. ipython-9.16.0/tests/test_application.py +373 -0
  225. ipython-9.16.0/tests/test_async_helpers.py +473 -0
  226. ipython-9.16.0/tests/test_autocall.py +157 -0
  227. ipython-9.16.0/tests/test_backgroundjobs.py +281 -0
  228. ipython-9.16.0/tests/test_clipboard.py +263 -0
  229. {ipython-9.15.0 → ipython-9.16.0}/tests/test_compilerop.py +20 -24
  230. ipython-9.16.0/tests/test_completer.py +2921 -0
  231. ipython-9.16.0/tests/test_completerlib.py +137 -0
  232. ipython-9.16.0/tests/test_contexts.py +72 -0
  233. ipython-9.16.0/tests/test_crashhandler.py +213 -0
  234. ipython-9.16.0/tests/test_data.py +76 -0
  235. ipython-9.16.0/tests/test_debugger.py +1993 -0
  236. ipython-9.16.0/tests/test_debugger_backport.py +171 -0
  237. ipython-9.16.0/tests/test_deepreload.py +316 -0
  238. ipython-9.16.0/tests/test_demo.py +434 -0
  239. ipython-9.16.0/tests/test_display.py +341 -0
  240. {ipython-9.15.0 → ipython-9.16.0}/tests/test_display_2.py +39 -4
  241. ipython-9.16.0/tests/test_display_functions.py +221 -0
  242. ipython-9.16.0/tests/test_display_trap.py +72 -0
  243. ipython-9.16.0/tests/test_doctb.py +319 -0
  244. ipython-9.16.0/tests/test_editorhooks.py +126 -0
  245. ipython-9.16.0/tests/test_embed.py +503 -0
  246. ipython-9.16.0/tests/test_encoding.py +97 -0
  247. ipython-9.16.0/tests/test_error.py +76 -0
  248. ipython-9.16.0/tests/test_events.py +88 -0
  249. ipython-9.16.0/tests/test_frame.py +16 -0
  250. ipython-9.16.0/tests/test_generics.py +63 -0
  251. {ipython-9.15.0 → ipython-9.16.0}/tests/test_guarded_eval.py +25 -0
  252. ipython-9.16.0/tests/test_guisupport.py +237 -0
  253. {ipython-9.15.0 → ipython-9.16.0}/tests/test_history.py +400 -86
  254. ipython-9.16.0/tests/test_historyapp.py +177 -0
  255. {ipython-9.15.0 → ipython-9.16.0}/tests/test_hooks.py +59 -0
  256. {ipython-9.15.0 → ipython-9.16.0}/tests/test_importstring.py +35 -11
  257. {ipython-9.15.0 → ipython-9.16.0}/tests/test_inputtransformer2.py +14 -12
  258. {ipython-9.15.0 → ipython-9.16.0}/tests/test_inputtransformer2_line.py +74 -32
  259. ipython-9.16.0/tests/test_interactiveshell.py +1445 -0
  260. ipython-9.16.0/tests/test_interactivshell.py +233 -0
  261. ipython-9.16.0/tests/test_io.py +71 -0
  262. ipython-9.16.0/tests/test_ipapp.py +441 -0
  263. {ipython-9.15.0 → ipython-9.16.0}/tests/test_iplib.py +3 -3
  264. ipython-9.16.0/tests/test_ipstruct.py +143 -0
  265. ipython-9.16.0/tests/test_logger.py +279 -0
  266. ipython-9.16.0/tests/test_logger_unit.py +192 -0
  267. ipython-9.16.0/tests/test_macro.py +107 -0
  268. {ipython-9.15.0 → ipython-9.16.0}/tests/test_magic.py +116 -107
  269. ipython-9.16.0/tests/test_magic_terminal.py +228 -0
  270. ipython-9.16.0/tests/test_magics_code.py +567 -0
  271. ipython-9.16.0/tests/test_magics_packaging.py +191 -0
  272. ipython-9.16.0/tests/test_magics_pylab.py +129 -0
  273. {ipython-9.15.0 → ipython-9.16.0}/tests/test_oinspect.py +34 -13
  274. ipython-9.16.0/tests/test_page.py +448 -0
  275. {ipython-9.15.0 → ipython-9.16.0}/tests/test_path.py +130 -148
  276. ipython-9.16.0/tests/test_payload.py +142 -0
  277. ipython-9.16.0/tests/test_pickleshare.py +319 -0
  278. {ipython-9.15.0 → ipython-9.16.0}/tests/test_pretty.py +125 -110
  279. {ipython-9.15.0 → ipython-9.16.0}/tests/test_process.py +102 -99
  280. ipython-9.16.0/tests/test_profile.py +291 -0
  281. ipython-9.16.0/tests/test_ptutils.py +262 -0
  282. {ipython-9.15.0 → ipython-9.16.0}/tests/test_pylabtools.py +38 -21
  283. ipython-9.16.0/tests/test_run.py +623 -0
  284. ipython-9.16.0/tests/test_sentinel.py +41 -0
  285. ipython-9.16.0/tests/test_shellapp.py +143 -0
  286. ipython-9.16.0/tests/test_shortcuts.py +1187 -0
  287. ipython-9.16.0/tests/test_splitinput.py +94 -0
  288. ipython-9.16.0/tests/test_storemagic.py +206 -0
  289. ipython-9.16.0/tests/test_strdispatch.py +87 -0
  290. ipython-9.16.0/tests/test_sysinfo.py +67 -0
  291. ipython-9.16.0/tests/test_syspathcontext.py +74 -0
  292. ipython-9.16.0/tests/test_terminal_utils.py +81 -0
  293. {ipython-9.15.0 → ipython-9.16.0}/tests/test_text.py +2 -2
  294. ipython-9.16.0/tests/test_text_utils.py +139 -0
  295. ipython-9.16.0/tests/test_timing.py +86 -0
  296. ipython-9.16.0/tests/test_tips.py +70 -0
  297. {ipython-9.15.0 → ipython-9.16.0}/tests/test_tokenutil.py +2 -2
  298. ipython-9.16.0/tests/test_tools.py +137 -0
  299. ipython-9.16.0/tests/test_ultratb.py +527 -0
  300. ipython-9.16.0/tests/test_utils_misc.py +246 -0
  301. ipython-9.16.0/tests/test_utils_terminal.py +129 -0
  302. ipython-9.16.0/tests/test_wildcard.py +118 -0
  303. ipython-9.16.0/tests/test_zzz_autoreload.py +1197 -0
  304. ipython-9.15.0/IPython/extensions/tests/test_deduperreload.py +0 -2377
  305. ipython-9.15.0/IPython/utils/_process_cli.py +0 -71
  306. ipython-9.15.0/IPython/utils/_process_win32_controller.py +0 -574
  307. ipython-9.15.0/IPython/utils/eventful.py +0 -5
  308. ipython-9.15.0/IPython/utils/frame.py +0 -97
  309. ipython-9.15.0/IPython/utils/jsonutil.py +0 -5
  310. ipython-9.15.0/IPython/utils/log.py +0 -5
  311. ipython-9.15.0/IPython/utils/py3compat.py +0 -61
  312. ipython-9.15.0/docs/autogen_magics.py +0 -66
  313. ipython-9.15.0/docs/source/development/inputhook_app.rst +0 -55
  314. ipython-9.15.0/docs/source/sphinx.toml +0 -67
  315. ipython-9.15.0/docs/source/whatsnew/development.rst +0 -52
  316. ipython-9.15.0/setup.cfg +0 -12
  317. ipython-9.15.0/tests/test_application.py +0 -72
  318. ipython-9.15.0/tests/test_async_helpers.py +0 -459
  319. ipython-9.15.0/tests/test_autocall.py +0 -68
  320. ipython-9.15.0/tests/test_backgroundjobs.py +0 -87
  321. ipython-9.15.0/tests/test_clipboard.py +0 -20
  322. ipython-9.15.0/tests/test_completer.py +0 -2895
  323. ipython-9.15.0/tests/test_completerlib.py +0 -196
  324. ipython-9.15.0/tests/test_debugger.py +0 -1042
  325. ipython-9.15.0/tests/test_deepreload.py +0 -57
  326. ipython-9.15.0/tests/test_display.py +0 -279
  327. ipython-9.15.0/tests/test_editorhooks.py +0 -38
  328. ipython-9.15.0/tests/test_embed.py +0 -149
  329. ipython-9.15.0/tests/test_events.py +0 -82
  330. ipython-9.15.0/tests/test_generics.py +0 -22
  331. ipython-9.15.0/tests/test_interactiveshell.py +0 -1280
  332. ipython-9.15.0/tests/test_interactivshell.py +0 -260
  333. ipython-9.15.0/tests/test_io.py +0 -60
  334. ipython-9.15.0/tests/test_logger.py +0 -28
  335. ipython-9.15.0/tests/test_magic_terminal.py +0 -220
  336. ipython-9.15.0/tests/test_page.py +0 -21
  337. ipython-9.15.0/tests/test_profile.py +0 -162
  338. ipython-9.15.0/tests/test_run.py +0 -686
  339. ipython-9.15.0/tests/test_shellapp.py +0 -56
  340. ipython-9.15.0/tests/test_shortcuts.py +0 -520
  341. ipython-9.15.0/tests/test_splitinput.py +0 -41
  342. ipython-9.15.0/tests/test_storemagic.py +0 -72
  343. ipython-9.15.0/tests/test_sysinfo.py +0 -17
  344. ipython-9.15.0/tests/test_tips.py +0 -12
  345. ipython-9.15.0/tests/test_tools.py +0 -128
  346. ipython-9.15.0/tests/test_ultratb.py +0 -539
  347. ipython-9.15.0/tests/test_wildcard.py +0 -264
  348. ipython-9.15.0/tests/test_zzz_autoreload.py +0 -1155
  349. {ipython-9.15.0 → ipython-9.16.0}/.flake8 +0 -0
  350. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/__init__.py +0 -0
  351. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/__init__.py +0 -0
  352. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/display.py +0 -0
  353. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/packaging.py +0 -0
  354. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/magics/pylab.py +0 -0
  355. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/payloadpage.py +0 -0
  356. {ipython-9.15.0 → ipython-9.16.0}/IPython/core/profile/README_STARTUP +0 -0
  357. {ipython-9.15.0 → ipython-9.16.0}/IPython/display.py +0 -0
  358. {ipython-9.15.0 → ipython-9.16.0}/IPython/extensions/deduperreload/__init__.py +0 -0
  359. {ipython-9.15.0 → ipython-9.16.0}/IPython/external/qt_for_kernel.py +0 -0
  360. {ipython-9.15.0 → ipython-9.16.0}/IPython/py.typed +0 -0
  361. {ipython-9.15.0 → ipython-9.16.0}/IPython/sphinxext/__init__.py +0 -0
  362. {ipython-9.15.0 → ipython-9.16.0}/IPython/sphinxext/ipython_console_highlighting.py +0 -0
  363. {ipython-9.15.0 → ipython-9.16.0}/IPython/sphinxext/tests/__init__.py +0 -0
  364. {ipython-9.15.0 → ipython-9.16.0}/IPython/sphinxext/tests/test_ansi_stripping.py +0 -0
  365. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/__init__.py +0 -0
  366. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/pt_inputhooks/asyncio.py +0 -0
  367. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/pt_inputhooks/glut.py +0 -0
  368. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/pt_inputhooks/gtk.py +0 -0
  369. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/pt_inputhooks/gtk3.py +0 -0
  370. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/pt_inputhooks/gtk4.py +0 -0
  371. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/pt_inputhooks/pyglet.py +0 -0
  372. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/pt_inputhooks/tk.py +0 -0
  373. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/pt_inputhooks/wx.py +0 -0
  374. {ipython-9.15.0 → ipython-9.16.0}/IPython/terminal/shortcuts/auto_match.py +0 -0
  375. {ipython-9.15.0/IPython/testing/plugin → ipython-9.16.0/IPython/terminal/tests}/__init__.py +0 -0
  376. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/__init__.py +0 -0
  377. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/plugin/Makefile +0 -0
  378. {ipython-9.15.0/IPython/utils → ipython-9.16.0/IPython/testing/plugin}/__init__.py +0 -0
  379. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/plugin/setup.py +0 -0
  380. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/plugin/simple.py +0 -0
  381. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/plugin/simplevars.py +0 -0
  382. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/plugin/test_combo.txt +0 -0
  383. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/plugin/test_example.txt +0 -0
  384. {ipython-9.15.0 → ipython-9.16.0}/IPython/testing/plugin/test_exampleip.txt +0 -0
  385. {ipython-9.15.0/tests → ipython-9.16.0/IPython/utils}/__init__.py +0 -0
  386. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/_process_emscripten.py +0 -0
  387. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/coloransi.py +0 -0
  388. {ipython-9.15.0 → ipython-9.16.0}/IPython/utils/docs.py +0 -0
  389. {ipython-9.15.0 → ipython-9.16.0}/LICENSE +0 -0
  390. {ipython-9.15.0 → ipython-9.16.0}/_build_meta.py +0 -0
  391. {ipython-9.15.0 → ipython-9.16.0}/docs/man/ipython.1 +0 -0
  392. {ipython-9.15.0 → ipython-9.16.0}/docs/requirements.txt +0 -0
  393. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/2.0/running-crop.png +0 -0
  394. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/2.0/running.png +0 -0
  395. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/2.0/treeview.png +0 -0
  396. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/2.0/user-interface.png +0 -0
  397. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/2.0/widgets.png +0 -0
  398. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/8.0/auto_suggest_1_prompt_no_text.png +0 -0
  399. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/8.0/auto_suggest_2_print_hello_suggest.png +0 -0
  400. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/8.0/auto_suggest_3_print_hello_suggest.png +0 -0
  401. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/8.0/auto_suggest_4_print_hello.png +0 -0
  402. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/8.0/auto_suggest_d_completions.png +0 -0
  403. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/8.0/auto_suggest_d_phantom.png +0 -0
  404. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/8.0/auto_suggest_def_completions.png +0 -0
  405. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/8.0/auto_suggest_def_phantom.png +0 -0
  406. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/8.0/auto_suggest_match_parens.png +0 -0
  407. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/8.0/auto_suggest_second_prompt.png +0 -0
  408. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/8.0/pathlib_pathlib_everywhere.jpg +0 -0
  409. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/autosuggest.gif +0 -0
  410. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipy_013_dashboard.png +0 -0
  411. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipy_013_dashboard_cluster.png +0 -0
  412. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipy_013_notebook_cythonmagic.png +0 -0
  413. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipy_013_notebook_long_out.png +0 -0
  414. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipy_013_notebook_octavemagic.png +0 -0
  415. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipy_013_notebook_rmagic.png +0 -0
  416. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipy_013_notebook_script_cells.png +0 -0
  417. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipy_013_notebook_spectrogram.png +0 -0
  418. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipy_013_notebook_tooltip.png +0 -0
  419. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipy_013_par_tb.png +0 -0
  420. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipy_013_qtconsole_baboon.png +0 -0
  421. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipy_013_qtconsole_completer.png +0 -0
  422. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ipython-6-screenshot.png +0 -0
  423. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/jedi_type_inference_60.png +0 -0
  424. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/kernel_selector_screenshot.png +0 -0
  425. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ms_visual_studio.png +0 -0
  426. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/notebook_specgram.png +0 -0
  427. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/ptshell_features.png +0 -0
  428. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/qtconsole.png +0 -0
  429. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/qtconsole_tabbed.png +0 -0
  430. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_images/unicode_completion.png +0 -0
  431. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_static/favicon.ico +0 -0
  432. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_static/logo.png +0 -0
  433. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_static/theme_overrides.css +0 -0
  434. {ipython-9.15.0 → ipython-9.16.0}/docs/source/_templates/notebook_redirect.html +0 -0
  435. {ipython-9.15.0 → ipython-9.16.0}/docs/source/api/index.rst +0 -0
  436. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/extensions/autoreload.rst +0 -0
  437. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/extensions/storemagic.rst +0 -0
  438. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/index.rst +0 -0
  439. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/options/index.rst +0 -0
  440. {ipython-9.15.0 → ipython-9.16.0}/docs/source/config/shortcuts/index.rst +0 -0
  441. {ipython-9.15.0 → ipython-9.16.0}/docs/source/development/figs/ipy_kernel_and_terminal.png +0 -0
  442. {ipython-9.15.0 → ipython-9.16.0}/docs/source/development/figs/ipy_kernel_and_terminal.svg +0 -0
  443. {ipython-9.15.0 → ipython-9.16.0}/docs/source/development/figs/other_kernels.png +0 -0
  444. {ipython-9.15.0 → ipython-9.16.0}/docs/source/development/figs/other_kernels.svg +0 -0
  445. {ipython-9.15.0 → ipython-9.16.0}/docs/source/development/kernels.rst +0 -0
  446. {ipython-9.15.0 → ipython-9.16.0}/docs/source/development/messaging.rst +0 -0
  447. {ipython-9.15.0 → ipython-9.16.0}/docs/source/install/kernel_install.rst +0 -0
  448. {ipython-9.15.0 → ipython-9.16.0}/docs/source/interactive/python-ipython-diff.rst +0 -0
  449. {ipython-9.15.0 → ipython-9.16.0}/docs/source/parallel/index.rst +0 -0
  450. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/github-stats-3.rst +0 -0
  451. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/github-stats-4.rst +0 -0
  452. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/github-stats-5.rst +0 -0
  453. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/github-stats-6.rst +0 -0
  454. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/github-stats-7.rst +0 -0
  455. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/github-stats-8.rst +0 -0
  456. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/index.rst +0 -0
  457. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/pr/README.md +0 -0
  458. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/pr/antigravity-feature.rst +0 -0
  459. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/pr/incompat-switching-to-perl.rst +0 -0
  460. {ipython-9.15.0 → ipython-9.16.0}/docs/source/whatsnew/version2.0.rst +0 -0
  461. {ipython-9.15.0 → ipython-9.16.0}/docs/sphinxext/configtraits.py +0 -0
  462. {ipython-9.15.0 → ipython-9.16.0}/docs/sphinxext/magics.py +0 -0
  463. {ipython-9.15.0 → ipython-9.16.0}/examples/Embedding/embed_class_short.py +0 -0
  464. {ipython-9.15.0 → ipython-9.16.0}/examples/Embedding/embed_function.py +0 -0
  465. {ipython-9.15.0 → ipython-9.16.0}/examples/IPython Kernel/example-demo.py +0 -0
  466. {ipython-9.15.0 → ipython-9.16.0}/examples/IPython Kernel/gui/gui-glut.py +0 -0
  467. {ipython-9.15.0 → ipython-9.16.0}/examples/IPython Kernel/gui/gui-gtk4.py +0 -0
  468. {ipython-9.15.0 → ipython-9.16.0}/examples/IPython Kernel/gui/gui-qt.py +0 -0
  469. {ipython-9.15.0 → ipython-9.16.0}/examples/IPython Kernel/ipython-completion.bash +0 -0
  470. {ipython-9.15.0 → ipython-9.16.0}/examples/IPython Kernel/ipython-get-history.py +0 -0
  471. {ipython-9.15.0 → ipython-9.16.0}/examples/IPython Kernel/ipython.desktop +0 -0
  472. {ipython-9.15.0 → ipython-9.16.0}/examples/auto_suggest_llm.py +0 -0
  473. {ipython-9.15.0 → ipython-9.16.0}/examples/utils/cwd_prompt.py +0 -0
  474. {ipython-9.15.0 → ipython-9.16.0}/ipython.egg-info/dependency_links.txt +0 -0
  475. {ipython-9.15.0 → ipython-9.16.0}/ipython.egg-info/entry_points.txt +0 -0
  476. {ipython-9.15.0 → ipython-9.16.0}/ipython.egg-info/not-zip-safe +0 -0
  477. {ipython-9.15.0 → ipython-9.16.0}/ipython.egg-info/top_level.txt +0 -0
  478. {ipython-9.15.0 → ipython-9.16.0}/long_description.rst +0 -0
  479. {ipython-9.15.0 → ipython-9.16.0}/scripts/ipython.ico +0 -0
  480. {ipython-9.15.0 → ipython-9.16.0}/scripts/ipython_nb.ico +0 -0
  481. {ipython-9.15.0 → ipython-9.16.0}/tests/2x2.jpg +0 -0
  482. {ipython-9.15.0 → ipython-9.16.0}/tests/2x2.png +0 -0
  483. {ipython-9.15.0 → ipython-9.16.0}/tests/bad_all.py +0 -0
  484. {ipython-9.15.0 → ipython-9.16.0}/tests/conftest.py +0 -0
  485. {ipython-9.15.0 → ipython-9.16.0}/tests/fake_ext_dir/daft_extension.py +0 -0
  486. {ipython-9.15.0 → ipython-9.16.0}/tests/fake_llm.py +0 -0
  487. {ipython-9.15.0 → ipython-9.16.0}/tests/nonascii.py +0 -0
  488. {ipython-9.15.0 → ipython-9.16.0}/tests/nonascii2.py +0 -0
  489. {ipython-9.15.0 → ipython-9.16.0}/tests/print_argv.py +0 -0
  490. {ipython-9.15.0 → ipython-9.16.0}/tests/refbug.py +0 -0
  491. {ipython-9.15.0 → ipython-9.16.0}/tests/simpleerr.py +0 -0
  492. {ipython-9.15.0 → ipython-9.16.0}/tests/tclass.py +0 -0
  493. {ipython-9.15.0 → ipython-9.16.0}/tests/test.wav +0 -0
  494. {ipython-9.15.0 → ipython-9.16.0}/tests/test_alias.py +0 -0
  495. {ipython-9.15.0 → ipython-9.16.0}/tests/test_capture.py +0 -0
  496. {ipython-9.15.0 → ipython-9.16.0}/tests/test_cve.py +0 -0
  497. {ipython-9.15.0 → ipython-9.16.0}/tests/test_debug_magic.py +0 -0
  498. {ipython-9.15.0 → ipython-9.16.0}/tests/test_decorators.py +0 -0
  499. {ipython-9.15.0 → ipython-9.16.0}/tests/test_decorators_2.py +0 -0
  500. {ipython-9.15.0 → ipython-9.16.0}/tests/test_dir2.py +0 -0
  501. {ipython-9.15.0 → ipython-9.16.0}/tests/test_displayhook.py +0 -0
  502. {ipython-9.15.0 → ipython-9.16.0}/tests/test_exceptiongroup_tb.py +0 -0
  503. {ipython-9.15.0 → ipython-9.16.0}/tests/test_extension.py +0 -0
  504. {ipython-9.15.0 → ipython-9.16.0}/tests/test_formatters.py +0 -0
  505. {ipython-9.15.0 → ipython-9.16.0}/tests/test_handlers.py +0 -0
  506. {ipython-9.15.0 → ipython-9.16.0}/tests/test_help.py +0 -0
  507. {ipython-9.15.0 → ipython-9.16.0}/tests/test_imports.py +0 -0
  508. {ipython-9.15.0 → ipython-9.16.0}/tests/test_ipunittest.py +0 -0
  509. {ipython-9.15.0 → ipython-9.16.0}/tests/test_ipython_directive.py +0 -0
  510. {ipython-9.15.0 → ipython-9.16.0}/tests/test_kitty.py +0 -0
  511. {ipython-9.15.0 → ipython-9.16.0}/tests/test_latextools.py +0 -0
  512. {ipython-9.15.0 → ipython-9.16.0}/tests/test_magic_arguments.py +0 -0
  513. {ipython-9.15.0 → ipython-9.16.0}/tests/test_module_paths.py +0 -0
  514. {ipython-9.15.0 → ipython-9.16.0}/tests/test_openpy.py +0 -0
  515. {ipython-9.15.0 → ipython-9.16.0}/tests/test_paths.py +0 -0
  516. {ipython-9.15.0 → ipython-9.16.0}/tests/test_prefilter.py +0 -0
  517. {ipython-9.15.0 → ipython-9.16.0}/tests/test_pt_inputhooks.py +0 -0
  518. {ipython-9.15.0 → ipython-9.16.0}/tests/test_pycolorize.py +0 -0
  519. {ipython-9.15.0 → ipython-9.16.0}/tests/test_qt_loaders.py +0 -0
  520. {ipython-9.15.0 → ipython-9.16.0}/tests/test_tempdir.py +0 -0
@@ -33,7 +33,7 @@ David P. Sanders <dpsanders@gmail.com> David P. Sanders <dpsanders@ciencias.unam
33
33
  David Warde-Farley <wardefar@iro.umontreal.ca> David Warde-Farley <>
34
34
  Dan Green-Leipciger <dangreen.tlv@gmail.com> <dangreen.tlv@gmail.com>
35
35
  Doug Blank <dblank@cs.brynmawr.edu> Doug Blank <doug.blank@gmail.com>
36
- Eugene Van den Bulke <eugene.van-den-bulke@gmail.com> Eugene Van den Bulke <eugene.vandenbulke@gmail.com>
36
+ Eugene Van den Bulke <eugene.van-den-bulke@gmail.com> Eugene Van den Bulke <eugene.vandenbulke@gmail.com>
37
37
  Evan Patterson <epatters@enthought.com> <epatters@EPattersons-MacBook-Pro.local>
38
38
  Evan Patterson <epatters@enthought.com> <epatters@evan-laptop.localdomain>
39
39
  Evan Patterson <epatters@enthought.com> <epatters@caltech.edu>
@@ -153,7 +153,7 @@ Juan Luis Cano Rodríguez <juanlu@readthedocs.org> <hello@juanlu.space>
153
153
  Tamir Bahar <tamir@north-bit.com> Tamir Bahar <tmr232@users.noreply.github.com>
154
154
  Ted Drain <ted.drain@gmail.com> TD22057 <ted.drain@gmail.com>
155
155
  Théophile Studer <theo.studer@gmail.com> Théophile Studer <studer@users.noreply.github.com>
156
- Thomas A Caswell <tcaswell@gmail.com> Thomas A Caswell <tcaswell@bnl.gov>
156
+ Thomas A Caswell <tcaswell@gmail.com> Thomas A Caswell <tcaswell@bnl.gov>
157
157
  Thomas Kluyver <thomas@kluyver.me.uk> Thomas <takowl@gmail.com>
158
158
  Thomas Kluyver <thomas@kluyver.me.uk> Thomas Kluyver <takowl@gmail.com>
159
159
  Thomas Spura <tomspur@fedoraproject.org> Thomas Spura <thomas.spura@gmail.com>
@@ -171,4 +171,3 @@ Walter Doerwald <walter@livinglogic.de> Walter Doerwald <>
171
171
  Wieland Hoffmann <themineo@gmail.com> Wieland Hoffmann <mineo@users.noreply.github.com>
172
172
  W. Trevor King <wking@tremily.us> W. Trevor King <wking@drexel.edu>
173
173
  Yoval P. <yoval@gmx.com> y-p <yoval@gmx.com>
174
-
@@ -2,15 +2,17 @@
2
2
  # See https://pre-commit.com/hooks.html for more hooks
3
3
  repos:
4
4
  - repo: https://github.com/pre-commit/pre-commit-hooks
5
- rev: v4.4.0
5
+ rev: v6.0.0
6
6
  hooks:
7
7
  - id: trailing-whitespace
8
+ exclude: 'tests/test_ipunittest\.py'
8
9
  - id: end-of-file-fixer
9
10
  - id: check-yaml
10
11
  - id: check-added-large-files
11
12
 
12
13
  - repo: https://github.com/akaihola/darker
13
- rev: 1.7.2
14
+ rev: v3.0.0
14
15
  hooks:
15
16
  - id: darker
16
- additional_dependencies: [isort, mypy, flake8]
17
+ args: [--formatter=ruff]
18
+ additional_dependencies: [ruff, isort, mypy, flake8]
@@ -14,7 +14,7 @@ Fernando Perez began IPython in 2001 based on code from Janko Hauser
14
14
  the project lead.
15
15
 
16
16
  The IPython Development Team is the set of all contributors to the IPython
17
- project. This includes all of the IPython subprojects.
17
+ project. This includes all of the IPython subprojects.
18
18
 
19
19
  The core team that coordinates development on GitHub can be found here:
20
20
  https://github.com/ipython/.
@@ -32,7 +32,7 @@ changes/contributions they have specific copyright on, they should indicate
32
32
  their copyright in the commit message of the change, when they commit the
33
33
  change to one of the IPython repositories.
34
34
 
35
- With this in mind, the following banner should be used in any source code file
35
+ With this in mind, the following banner should be used in any source code file
36
36
  to indicate the copyright and license terms:
37
37
 
38
38
  ::
@@ -21,35 +21,19 @@ https://ipython.org
21
21
 
22
22
  import sys
23
23
  import warnings
24
+ from typing import Any
24
25
 
25
26
  #-----------------------------------------------------------------------------
26
27
  # Setup everything
27
28
  #-----------------------------------------------------------------------------
28
29
 
29
30
  # Don't forget to also update setup.py when this changes!
30
- if sys.version_info < (3, 11):
31
- raise ImportError(
32
- """
33
- IPython 9.x supports Python 3.11 and above, following SPEC0
34
- IPython 8.19+ supports Python 3.10 and above, following SPEC0.
35
- IPython 8.13+ supports Python 3.9 and above, following NEP 29.
36
- When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
37
- Python 3.3 and 3.4 were supported up to IPython 6.x.
38
- Python 3.5 was supported with IPython 7.0 to 7.9.
39
- Python 3.6 was supported with IPython up to 7.16.
40
- Python 3.7 was still supported with the 7.x branch.
41
-
42
- See IPython `README.rst` file for more information:
43
-
44
- https://github.com/ipython/ipython/blob/main/README.rst
45
-
46
- """
47
- )
48
-
49
- #-----------------------------------------------------------------------------
50
- # Setup the top level names
51
- #-----------------------------------------------------------------------------
52
-
31
+ #
32
+ # NOTE: these imports look like they could be made lazy (PEP 562) to speed up
33
+ # `import IPython` considerably, but downstream projects (pyflyby at least)
34
+ # rely on the transitive side effects: they do `import IPython` and then
35
+ # access attribute chains like `IPython.terminal.ipapp.TerminalIPythonApp`,
36
+ # which only resolve because the imports below load those submodules.
53
37
  from .core.getipython import get_ipython
54
38
  from .core import release
55
39
  from .core.application import Application
@@ -62,7 +46,7 @@ from .utils.frame import extract_module_locals
62
46
  __all__ = ["start_ipython", "embed", "embed_kernel"]
63
47
 
64
48
  # Release data
65
- __author__ = '%s <%s>' % (release.author, release.author_email)
49
+ __author__ = '{} <{}>'.format(release.author, release.author_email)
66
50
  __license__ = release.license
67
51
  __version__ = release.version
68
52
  version_info = release.version_info
@@ -109,12 +93,12 @@ def embed_kernel(module=None, local_ns=None, **kwargs):
109
93
  module = caller_module
110
94
  if local_ns is None:
111
95
  local_ns = dict(**caller_locals)
112
-
96
+
113
97
  # Only import .zmq when we really need it
114
98
  from ipykernel.embed import embed_kernel as real_embed_kernel
115
99
  real_embed_kernel(module=module, local_ns=local_ns, **kwargs)
116
100
 
117
- def start_ipython(argv=None, **kwargs):
101
+ def start_ipython(argv: list[str] | None = None, **kwargs: Any) -> Any:
118
102
  """Launch a normal IPython instance (as opposed to embedded)
119
103
 
120
104
  `IPython.embed()` puts a shell in a particular calling scope,
@@ -1,5 +1,4 @@
1
1
  # PYTHON_ARGCOMPLETE_OK
2
- # encoding: utf-8
3
2
  """Terminal-based IPython entry point."""
4
3
  # -----------------------------------------------------------------------------
5
4
  # Copyright (c) 2012, IPython Development Team.
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  """
3
2
  System command aliases.
4
3
 
@@ -7,6 +6,7 @@ Authors:
7
6
  * Fernando Perez
8
7
  * Brian Granger
9
8
  """
9
+ from __future__ import annotations
10
10
 
11
11
  #-----------------------------------------------------------------------------
12
12
  # Copyright (C) 2008-2011 The IPython Development Team
@@ -30,8 +30,6 @@ from .error import UsageError
30
30
  from traitlets import List, Instance
31
31
  from logging import error
32
32
 
33
- import typing as t
34
-
35
33
 
36
34
  #-----------------------------------------------------------------------------
37
35
  # Utilities
@@ -40,7 +38,7 @@ import typing as t
40
38
  # This is used as the pattern for calls to split_user_input.
41
39
  shell_line_split = re.compile(r'^(\s*)()(\S+)(.*$)')
42
40
 
43
- def default_aliases() -> t.List[t.Tuple[str, str]]:
41
+ def default_aliases() -> list[tuple[str, str]]:
44
42
  """Return list of shell aliases to auto-define.
45
43
  """
46
44
  # Note: the aliases defined here should be safe to use on a kernel
@@ -134,7 +132,7 @@ class Alias:
134
132
  self.shell = shell
135
133
  self.name = name
136
134
  self.cmd = cmd
137
- self.__doc__ = "Alias for `!{}`".format(cmd)
135
+ self.__doc__ = f"Alias for `!{cmd}`"
138
136
  self.nargs = self.validate()
139
137
 
140
138
  def validate(self):
@@ -156,7 +154,7 @@ class Alias:
156
154
  "got: %r" % self.cmd)
157
155
 
158
156
  nargs = self.cmd.count('%s') - self.cmd.count('%%s')
159
-
157
+
160
158
  if (nargs > 0) and (self.cmd.find('%l') >= 0):
161
159
  raise InvalidAliasError('The %s and %l specifiers are mutually '
162
160
  'exclusive in alias definitions.')
@@ -164,7 +162,7 @@ class Alias:
164
162
  return nargs
165
163
 
166
164
  def __repr__(self):
167
- return "<alias {} for {!r}>".format(self.name, self.cmd)
165
+ return f"<alias {self.name} for {self.cmd!r}>"
168
166
 
169
167
  def __call__(self, rest=''):
170
168
  cmd = self.cmd
@@ -173,19 +171,19 @@ class Alias:
173
171
  if cmd.find('%l') >= 0:
174
172
  cmd = cmd.replace('%l', rest)
175
173
  rest = ''
176
-
174
+
177
175
  if nargs==0:
178
176
  if cmd.find('%%s') >= 1:
179
177
  cmd = cmd.replace('%%s', '%s')
180
178
  # Simple, argument-less aliases
181
- cmd = '%s %s' % (cmd, rest)
179
+ cmd = '{} {}'.format(cmd, rest)
182
180
  else:
183
181
  # Handle aliases with positional arguments
184
182
  args = rest.split(None, nargs)
185
183
  if len(args) < nargs:
186
184
  raise UsageError('Alias <%s> requires %s arguments, %s given.' %
187
185
  (self.name, nargs, len(args)))
188
- cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
186
+ cmd = '{} {}'.format(cmd % tuple(args[:nargs]),' '.join(args[nargs:]))
189
187
 
190
188
  self.shell.system(cmd)
191
189
 
@@ -201,7 +199,7 @@ class AliasManager(Configurable):
201
199
  )
202
200
 
203
201
  def __init__(self, shell=None, **kwargs):
204
- super(AliasManager, self).__init__(shell=shell, **kwargs)
202
+ super().__init__(shell=shell, **kwargs)
205
203
  # For convenient access
206
204
  if self.shell is not None:
207
205
  self.linemagics = self.shell.magics_manager.magics["line"]
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  """
3
2
  An application for IPython.
4
3
 
@@ -121,7 +120,7 @@ class ProfileAwareConfigLoader(PyFileConfigLoader):
121
120
  except ProfileDirError:
122
121
  return
123
122
  path = profile_dir.location
124
- return super(ProfileAwareConfigLoader, self).load_subconfig(fname, path=path)
123
+ return super().load_subconfig(fname, path=path)
125
124
 
126
125
  class BaseIPythonApplication(Application):
127
126
  name = "ipython"
@@ -131,7 +130,7 @@ class BaseIPythonApplication(Application):
131
130
  aliases = base_aliases
132
131
  flags = base_flags
133
132
  classes = List([ProfileDir])
134
-
133
+
135
134
  # enable `load_subconfig('cfg.py', profile='name')`
136
135
  python_config_loader_class = ProfileAwareConfigLoader
137
136
 
@@ -142,7 +141,7 @@ class BaseIPythonApplication(Application):
142
141
  config_file_name = Unicode()
143
142
  @default('config_file_name')
144
143
  def _config_file_name_default(self):
145
- return self.name.replace('-','_') + u'_config.py'
144
+ return self.name.replace('-','_') + '_config.py'
146
145
  @observe('config_file_name')
147
146
  def _config_file_name_changed(self, change):
148
147
  if change['new'] != change['old']:
@@ -150,17 +149,16 @@ class BaseIPythonApplication(Application):
150
149
 
151
150
  # The directory that contains IPython's builtin profiles.
152
151
  builtin_profile_dir = Unicode(
153
- os.path.join(get_ipython_package_dir(), u'config', u'profile', u'default')
152
+ os.path.join(get_ipython_package_dir(), 'config', 'profile', 'default')
154
153
  )
155
-
154
+
156
155
  config_file_paths = List(Unicode())
157
156
  @default('config_file_paths')
158
157
  def _config_file_paths_default(self):
159
158
  return []
160
159
 
161
- extra_config_file = Unicode(
162
- help="""Path to an extra config file to load.
163
-
160
+ extra_config_file = Unicode(help="""Path to an extra config file to load.
161
+
164
162
  If specified, load this config file in addition to any other IPython config.
165
163
  """).tag(config=True)
166
164
  @observe('extra_config_file')
@@ -174,14 +172,14 @@ class BaseIPythonApplication(Application):
174
172
  self.config_file_specified.add(new)
175
173
  self.config_files.append(new)
176
174
 
177
- profile = Unicode(u'default',
175
+ profile = Unicode('default',
178
176
  help="""The IPython profile to use."""
179
177
  ).tag(config=True)
180
-
178
+
181
179
  @observe('profile')
182
180
  def _profile_changed(self, change):
183
181
  self.builtin_profile_dir = os.path.join(
184
- get_ipython_package_dir(), u'config', u'profile', change['new']
182
+ get_ipython_package_dir(), 'config', 'profile', change['new']
185
183
  )
186
184
 
187
185
  add_ipython_dir_to_sys_path = Bool(
@@ -212,7 +210,7 @@ class BaseIPythonApplication(Application):
212
210
  'new': d,
213
211
  })
214
212
  return d
215
-
213
+
216
214
  _in_init_profile_dir = False
217
215
 
218
216
  profile_dir = Instance(ProfileDir, allow_none=True)
@@ -246,7 +244,7 @@ class BaseIPythonApplication(Application):
246
244
  profile, then they will be staged into the new directory. Otherwise,
247
245
  default config files will be automatically generated.
248
246
  """).tag(config=True)
249
-
247
+
250
248
  verbose_crash = Bool(False,
251
249
  help="""Create a massive crash report when IPython encounters what may be an
252
250
  internal error. The default is to append a short message to the
@@ -257,11 +255,11 @@ class BaseIPythonApplication(Application):
257
255
 
258
256
  @catch_config_error
259
257
  def __init__(self, **kwargs):
260
- super(BaseIPythonApplication, self).__init__(**kwargs)
258
+ super().__init__(**kwargs)
261
259
  # ensure current working directory exists
262
260
  try:
263
261
  os.getcwd()
264
- except:
262
+ except OSError:
265
263
  # exit if cwd doesn't exist
266
264
  self.log.error("Current working directory doesn't exist.")
267
265
  self.exit(1)
@@ -269,7 +267,7 @@ class BaseIPythonApplication(Application):
269
267
  #-------------------------------------------------------------------------
270
268
  # Various stages of Application creation
271
269
  #-------------------------------------------------------------------------
272
-
270
+
273
271
  def init_crash_handler(self):
274
272
  """Create a crash handler, typically setting sys.excepthook to it."""
275
273
  self.crash_handler = self.crash_handler_class(self)
@@ -277,14 +275,14 @@ class BaseIPythonApplication(Application):
277
275
  def unset_crashhandler():
278
276
  sys.excepthook = sys.__excepthook__
279
277
  atexit.register(unset_crashhandler)
280
-
278
+
281
279
  def excepthook(self, etype, evalue, tb):
282
280
  """this is sys.excepthook after init_crashhandler
283
281
 
284
282
  set self.verbose_crash=True to use our full crashhandler, instead of
285
283
  a regular traceback with a short message (crash_handler_lite)
286
284
  """
287
-
285
+
288
286
  if self.verbose_crash:
289
287
  return self.crash_handler(etype, evalue, tb)
290
288
  else:
@@ -355,7 +353,7 @@ class BaseIPythonApplication(Application):
355
353
  pass
356
354
  if suppress_errors is not None:
357
355
  Application.raise_config_file_errors = old_value
358
-
356
+
359
357
  for config_file_name in self.config_files:
360
358
  if not config_file_name or config_file_name == base_config:
361
359
  continue
@@ -15,7 +15,7 @@ import asyncio
15
15
  import inspect
16
16
  from functools import wraps
17
17
 
18
- _asyncio_event_loop = None
18
+ _asyncio_event_loop: asyncio.AbstractEventLoop | None = None
19
19
 
20
20
 
21
21
  def get_asyncio_loop():
@@ -131,7 +131,7 @@ def _pseudo_sync_runner(coro):
131
131
  else:
132
132
  # TODO: do not raise but return an execution result with the right info.
133
133
  raise RuntimeError(
134
- "{coro_name!r} needs a real async loop".format(coro_name=coro.__name__)
134
+ f"{coro.__name__!r} needs a real async loop"
135
135
  )
136
136
 
137
137
 
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  """
3
2
  Autocall capabilities for IPython.core.
4
3
 
@@ -29,8 +28,8 @@ Notes
29
28
  #-----------------------------------------------------------------------------
30
29
 
31
30
  class IPyAutocall:
32
- """ Instances of this class are always autocalled
33
-
31
+ """Instances of this class are always autocalled
32
+
34
33
  This happens regardless of 'autocall' variable state. Use this to
35
34
  develop macro-like mechanisms.
36
35
  """
@@ -38,7 +37,7 @@ class IPyAutocall:
38
37
  rewrite = True
39
38
  def __init__(self, ip=None):
40
39
  self._ip = ip
41
-
40
+
42
41
  def set_ip(self, ip):
43
42
  """Will be used to set _ip point to current ipython instance b/f call
44
43
 
@@ -52,13 +51,14 @@ class ExitAutocall(IPyAutocall):
52
51
  """An autocallable object which will be added to the user namespace so that
53
52
  exit, exit(), quit or quit() are all valid ways to close the shell."""
54
53
  rewrite = False
55
-
54
+
56
55
  def __call__(self):
57
56
  self._ip.ask_exit()
58
-
57
+
58
+
59
59
  class ZMQExitAutocall(ExitAutocall):
60
60
  """Exit IPython. Autocallable, so it needn't be explicitly called.
61
-
61
+
62
62
  Parameters
63
63
  ----------
64
64
  keep_kernel : bool
@@ -3,12 +3,18 @@ A context manager for managing things injected into :mod:`builtins`.
3
3
  """
4
4
  # Copyright (c) IPython Development Team.
5
5
  # Distributed under the terms of the Modified BSD License.
6
+ from __future__ import annotations
7
+
6
8
  import builtins as builtin_mod
9
+ from typing import Any, Literal, TYPE_CHECKING
7
10
 
8
11
  from traitlets.config.configurable import Configurable
9
12
 
10
13
  from traitlets import Instance
11
14
 
15
+ if TYPE_CHECKING:
16
+ from types import TracebackType
17
+
12
18
 
13
19
  class __BuiltinUndefined:
14
20
  pass
@@ -29,35 +35,36 @@ class BuiltinTrap(Configurable):
29
35
  shell = Instance('IPython.core.interactiveshell.InteractiveShellABC',
30
36
  allow_none=True)
31
37
 
32
- def __init__(self, shell=None):
33
- super(BuiltinTrap, self).__init__(shell=shell, config=None)
34
- self._orig_builtins = {}
38
+ def __init__(self, shell: Any = None) -> None:
39
+ super().__init__(shell=shell, config=None)
40
+ self._orig_builtins: dict[str, Any] = {}
35
41
  # We define this to track if a single BuiltinTrap is nested.
36
42
  # Only turn off the trap when the outermost call to __exit__ is made.
37
43
  self._nested_level = 0
38
44
  self.shell = shell
39
45
  # builtins we always add - if set to HideBuiltin, they will just
40
46
  # be removed instead of being replaced by something else
41
- self.auto_builtins = {'exit': HideBuiltin,
42
- 'quit': HideBuiltin,
43
- 'get_ipython': self.shell.get_ipython,
44
- }
47
+ self.auto_builtins: dict[str, Any] = {
48
+ 'exit': HideBuiltin,
49
+ 'quit': HideBuiltin,
50
+ 'get_ipython': self.shell.get_ipython,
51
+ }
45
52
 
46
- def __enter__(self):
53
+ def __enter__(self) -> BuiltinTrap:
47
54
  if self._nested_level == 0:
48
55
  self.activate()
49
56
  self._nested_level += 1
50
57
  # I return self, so callers can use add_builtin in a with clause.
51
58
  return self
52
59
 
53
- def __exit__(self, type, value, traceback):
60
+ def __exit__(self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None) -> Literal[False]:
54
61
  if self._nested_level == 1:
55
62
  self.deactivate()
56
63
  self._nested_level -= 1
57
64
  # Returning False will cause exceptions to propagate
58
65
  return False
59
66
 
60
- def add_builtin(self, key, value):
67
+ def add_builtin(self, key: str, value: Any) -> None:
61
68
  """Add a builtin and save the original."""
62
69
  bdict = builtin_mod.__dict__
63
70
  orig = bdict.get(key, BuiltinUndefined)
@@ -69,25 +76,24 @@ class BuiltinTrap(Configurable):
69
76
  self._orig_builtins[key] = orig
70
77
  bdict[key] = value
71
78
 
72
- def remove_builtin(self, key, orig):
79
+ def remove_builtin(self, key: str, orig: Any) -> None:
73
80
  """Remove an added builtin and re-set the original."""
74
81
  if orig is BuiltinUndefined:
75
82
  del builtin_mod.__dict__[key]
76
83
  else:
77
84
  builtin_mod.__dict__[key] = orig
78
85
 
79
- def activate(self):
86
+ def activate(self) -> None:
80
87
  """Store ipython references in the __builtin__ namespace."""
81
88
 
82
89
  add_builtin = self.add_builtin
83
90
  for name, func in self.auto_builtins.items():
84
91
  add_builtin(name, func)
85
92
 
86
- def deactivate(self):
93
+ def deactivate(self) -> None:
87
94
  """Remove any builtins which might have been added by add_builtins, or
88
95
  restore overwritten ones to their previous values."""
89
96
  remove_builtin = self.remove_builtin
90
97
  for key, val in self._orig_builtins.items():
91
98
  remove_builtin(key, val)
92
99
  self._orig_builtins.clear()
93
- self._builtins_added = False
@@ -26,6 +26,10 @@ Authors
26
26
  # Imports
27
27
  #-----------------------------------------------------------------------------
28
28
 
29
+ from __future__ import annotations
30
+
31
+ import ast
32
+
29
33
  # Stdlib imports
30
34
  import __future__
31
35
  from ast import PyCF_ONLY_AST
@@ -34,8 +38,8 @@ import functools
34
38
  import hashlib
35
39
  import linecache
36
40
  import operator
37
- import time
38
41
  from contextlib import contextmanager
42
+ from collections.abc import Generator
39
43
 
40
44
  #-----------------------------------------------------------------------------
41
45
  # Constants
@@ -51,16 +55,16 @@ PyCF_MASK = functools.reduce(operator.or_,
51
55
  # Local utilities
52
56
  #-----------------------------------------------------------------------------
53
57
 
54
- def code_name(code, number=0) -> str:
58
+ def code_name(code: str, number: int = 0) -> str:
55
59
  """ Compute a (probably) unique name for code for caching.
56
60
 
57
61
  This now expects code to be unicode.
58
62
  """
59
- hash_digest = hashlib.sha1(code.encode("utf-8")).hexdigest()
63
+ hash_digest = hashlib.sha1(code.encode("utf-8"), usedforsecurity=False).hexdigest()
60
64
  # Include the number and 12 characters of the hash in the name. It's
61
65
  # pretty much impossible that in a single session we'll have collisions
62
66
  # even with truncated hashes, and the full one makes tracebacks too long
63
- return '<ipython-input-{0}-{1}>'.format(number, hash_digest[:12])
67
+ return f'<ipython-input-{number}-{hash_digest[:12]}>'
64
68
 
65
69
  #-----------------------------------------------------------------------------
66
70
  # Classes and functions
@@ -78,26 +82,26 @@ class CachingCompiler(codeop.Compile):
78
82
  # argument used for the builtins.compile function.
79
83
  self._filename_map = {}
80
84
 
81
- def ast_parse(self, source, filename='<unknown>', symbol='exec'):
85
+ def ast_parse(self, source: str, filename: str = '<unknown>', symbol: str = 'exec') -> ast.AST:
82
86
  """Parse code to an AST with the current compiler flags active.
83
87
 
84
88
  Arguments are exactly the same as ast.parse (in the standard library),
85
89
  and are passed to the built-in compile function."""
86
90
  return compile(source, filename, symbol, self.flags | PyCF_ONLY_AST, 1)
87
91
 
88
- def reset_compiler_flags(self):
92
+ def reset_compiler_flags(self) -> None:
89
93
  """Reset compiler flags to default state."""
90
94
  # This value is copied from codeop.Compile.__init__, so if that ever
91
95
  # changes, it will need to be updated.
92
96
  self.flags = codeop.PyCF_DONT_IMPLY_DEDENT
93
97
 
94
98
  @property
95
- def compiler_flags(self):
99
+ def compiler_flags(self) -> int:
96
100
  """Flags currently active in the compilation process.
97
101
  """
98
102
  return self.flags
99
103
 
100
- def get_code_name(self, raw_code, transformed_code, number):
104
+ def get_code_name(self, raw_code: str, transformed_code: str, number: int) -> str:
101
105
  """Compute filename given the code, and the cell number.
102
106
 
103
107
  Parameters
@@ -116,7 +120,7 @@ class CachingCompiler(codeop.Compile):
116
120
  """
117
121
  return code_name(transformed_code, number)
118
122
 
119
- def format_code_name(self, name) -> str:
123
+ def format_code_name(self, name: str) -> tuple[str, str] | None:
120
124
  """Return a user-friendly label and name for a code block.
121
125
 
122
126
  Parameters
@@ -131,7 +135,7 @@ class CachingCompiler(codeop.Compile):
131
135
  if name in self._filename_map:
132
136
  return "Cell", "In[%s]" % self._filename_map[name]
133
137
 
134
- def cache(self, transformed_code, number=0, raw_code=None):
138
+ def cache(self, transformed_code: str, number: int = 0, raw_code: str | None = None) -> str:
135
139
  """Make a name for a block of code, and cache the code.
136
140
 
137
141
  Parameters
@@ -178,7 +182,7 @@ class CachingCompiler(codeop.Compile):
178
182
  return name
179
183
 
180
184
  @contextmanager
181
- def extra_flags(self, flags):
185
+ def extra_flags(self, flags: int) -> Generator[None, None, None]:
182
186
  ## bits that we'll set to 1
183
187
  turn_on_bits = ~self.flags & flags
184
188