ipython 9.17.1__tar.gz → 9.18.1__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 (492) hide show
  1. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/completer.py +170 -19
  2. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/display.py +20 -11
  3. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/displayhook.py +7 -2
  4. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/formatters.py +9 -1
  5. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/history.py +13 -7
  6. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/hooks.py +19 -3
  7. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/inputtransformer2.py +10 -4
  8. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/kitty.py +36 -7
  9. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magic.py +65 -14
  10. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/code.py +3 -6
  11. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/execution.py +5 -1
  12. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/namespace.py +4 -1
  13. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/packaging.py +14 -11
  14. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/release.py +1 -1
  15. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/usage.py +2 -2
  16. {ipython-9.17.1 → ipython-9.18.1}/IPython/extensions/tests/test_deduperreload.py +9 -15
  17. {ipython-9.17.1 → ipython-9.18.1}/IPython/lib/display.py +3 -2
  18. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/pytest_ipdoctest.py +5 -1
  19. ipython-9.18.1/IPython/utils/PyColorize.py +742 -0
  20. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/_sysinfo.py +1 -1
  21. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/text.py +2 -2
  22. ipython-9.18.1/IPython/utils/themes/gruvbox-dark.json +27 -0
  23. ipython-9.18.1/IPython/utils/themes/lightbg.json +29 -0
  24. ipython-9.18.1/IPython/utils/themes/linux.json +29 -0
  25. ipython-9.18.1/IPython/utils/themes/neutral-nt.json +36 -0
  26. ipython-9.18.1/IPython/utils/themes/neutral-posix.json +36 -0
  27. ipython-9.18.1/IPython/utils/themes/nocolor.json +5 -0
  28. ipython-9.18.1/IPython/utils/themes/pride-l.json +55 -0
  29. ipython-9.18.1/IPython/utils/themes/pride.json +40 -0
  30. {ipython-9.17.1 → ipython-9.18.1}/MANIFEST.in +1 -0
  31. {ipython-9.17.1 → ipython-9.18.1}/PKG-INFO +2 -3
  32. {ipython-9.17.1 → ipython-9.18.1}/README.rst +0 -3
  33. {ipython-9.17.1 → ipython-9.18.1}/docs/requirements.txt +0 -1
  34. {ipython-9.17.1 → ipython-9.18.1}/docs/source/about/license_and_copyright.rst +2 -0
  35. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/details.rst +77 -6
  36. {ipython-9.17.1 → ipython-9.18.1}/docs/source/interactive/autoawait.rst +11 -0
  37. {ipython-9.17.1 → ipython-9.18.1}/docs/source/interactive/reference.rst +8 -8
  38. {ipython-9.17.1 → ipython-9.18.1}/docs/source/sphinx.toml +1 -1
  39. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/index.rst +0 -11
  40. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version0.11.rst +1 -2
  41. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version0.12.rst +2 -5
  42. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version0.13.rst +2 -4
  43. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version1.0.rst +1 -3
  44. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version2.0.rst +1 -19
  45. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version3.rst +21 -28
  46. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version5.rst +1 -1
  47. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version9.rst +176 -6
  48. {ipython-9.17.1 → ipython-9.18.1}/docs/sphinxext/apigen.py +1 -1
  49. {ipython-9.17.1 → ipython-9.18.1}/ipython.egg-info/PKG-INFO +2 -3
  50. {ipython-9.17.1 → ipython-9.18.1}/ipython.egg-info/SOURCES.txt +13 -11
  51. {ipython-9.17.1 → ipython-9.18.1}/ipython.egg-info/requires.txt +1 -2
  52. {ipython-9.17.1 → ipython-9.18.1}/pyproject.toml +10 -2
  53. ipython-9.18.1/tests/hill-alpha.webp +0 -0
  54. ipython-9.18.1/tests/hill-animated.webp +0 -0
  55. ipython-9.18.1/tests/hill-lossless.webp +0 -0
  56. ipython-9.18.1/tests/hill-lossy.webp +0 -0
  57. {ipython-9.17.1 → ipython-9.18.1}/tests/test_async_helpers.py +1 -4
  58. {ipython-9.17.1 → ipython-9.18.1}/tests/test_completer.py +118 -1
  59. {ipython-9.17.1 → ipython-9.18.1}/tests/test_debugger.py +18 -10
  60. {ipython-9.17.1 → ipython-9.18.1}/tests/test_demo.py +1 -1
  61. {ipython-9.17.1 → ipython-9.18.1}/tests/test_display.py +11 -1
  62. {ipython-9.17.1 → ipython-9.18.1}/tests/test_display_2.py +71 -4
  63. {ipython-9.17.1 → ipython-9.18.1}/tests/test_exceptiongroup_tb.py +6 -24
  64. {ipython-9.17.1 → ipython-9.18.1}/tests/test_formatters.py +19 -0
  65. {ipython-9.17.1 → ipython-9.18.1}/tests/test_help.py +3 -5
  66. {ipython-9.17.1 → ipython-9.18.1}/tests/test_history.py +29 -1
  67. {ipython-9.17.1 → ipython-9.18.1}/tests/test_hooks.py +75 -0
  68. {ipython-9.17.1 → ipython-9.18.1}/tests/test_inputtransformer2.py +15 -0
  69. {ipython-9.17.1 → ipython-9.18.1}/tests/test_interactiveshell.py +40 -10
  70. {ipython-9.17.1 → ipython-9.18.1}/tests/test_kitty.py +78 -0
  71. {ipython-9.17.1 → ipython-9.18.1}/tests/test_magic.py +282 -12
  72. {ipython-9.17.1 → ipython-9.18.1}/tests/test_magic_table.py +7 -5
  73. {ipython-9.17.1 → ipython-9.18.1}/tests/test_magics_code.py +5 -6
  74. {ipython-9.17.1 → ipython-9.18.1}/tests/test_magics_packaging.py +21 -2
  75. {ipython-9.17.1 → ipython-9.18.1}/tests/test_run.py +23 -0
  76. {ipython-9.17.1 → ipython-9.18.1}/tests/test_text_utils.py +10 -0
  77. ipython-9.18.1/tests/test_themes.py +419 -0
  78. {ipython-9.17.1 → ipython-9.18.1}/tests/test_zzz_autoreload.py +13 -16
  79. ipython-9.17.1/IPython/utils/PyColorize.py +0 -665
  80. ipython-9.17.1/docs/source/whatsnew/github-stats-0.11.rst +0 -528
  81. ipython-9.17.1/docs/source/whatsnew/github-stats-0.12.rst +0 -621
  82. ipython-9.17.1/docs/source/whatsnew/github-stats-0.13.rst +0 -1203
  83. ipython-9.17.1/docs/source/whatsnew/github-stats-1.0.rst +0 -1883
  84. ipython-9.17.1/docs/source/whatsnew/github-stats-2.0.rst +0 -1607
  85. ipython-9.17.1/docs/source/whatsnew/github-stats-3.rst +0 -269
  86. ipython-9.17.1/docs/source/whatsnew/github-stats-4.rst +0 -178
  87. ipython-9.17.1/docs/source/whatsnew/github-stats-5.rst +0 -201
  88. ipython-9.17.1/docs/source/whatsnew/github-stats-6.rst +0 -184
  89. ipython-9.17.1/docs/source/whatsnew/github-stats-7.rst +0 -544
  90. ipython-9.17.1/docs/source/whatsnew/github-stats-8.rst +0 -111
  91. {ipython-9.17.1 → ipython-9.18.1}/.flake8 +0 -0
  92. {ipython-9.17.1 → ipython-9.18.1}/.mailmap +0 -0
  93. {ipython-9.17.1 → ipython-9.18.1}/.pre-commit-config.yaml +0 -0
  94. {ipython-9.17.1 → ipython-9.18.1}/COPYING.rst +0 -0
  95. {ipython-9.17.1 → ipython-9.18.1}/IPython/__init__.py +0 -0
  96. {ipython-9.17.1 → ipython-9.18.1}/IPython/__main__.py +0 -0
  97. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/__init__.py +0 -0
  98. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/_dunder_ops.py +0 -0
  99. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/alias.py +0 -0
  100. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/application.py +0 -0
  101. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/async_helpers.py +0 -0
  102. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/autocall.py +0 -0
  103. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/builtin_trap.py +0 -0
  104. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/compilerop.py +0 -0
  105. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/completerlib.py +0 -0
  106. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/crashhandler.py +0 -0
  107. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/debugger.py +0 -0
  108. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/debugger_backport.py +0 -0
  109. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/display_functions.py +0 -0
  110. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/display_trap.py +0 -0
  111. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/displaypub.py +0 -0
  112. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/doctb.py +0 -0
  113. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/error.py +0 -0
  114. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/events.py +0 -0
  115. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/extensions.py +0 -0
  116. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/getipython.py +0 -0
  117. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/guarded_eval.py +0 -0
  118. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/historyapp.py +0 -0
  119. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/interactiveshell.py +0 -0
  120. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/latex_symbols.py +0 -0
  121. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/logger.py +0 -0
  122. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/macro.py +0 -0
  123. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magic_arguments.py +0 -0
  124. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/__init__.py +0 -0
  125. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/_table.py +0 -0
  126. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/ast_mod.py +0 -0
  127. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/auto.py +0 -0
  128. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/basic.py +0 -0
  129. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/config.py +0 -0
  130. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/display.py +0 -0
  131. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/extension.py +0 -0
  132. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/history.py +0 -0
  133. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/logging.py +0 -0
  134. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/osm.py +0 -0
  135. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/pylab.py +0 -0
  136. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/magics/script.py +0 -0
  137. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/oinspect.py +0 -0
  138. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/page.py +0 -0
  139. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/payload.py +0 -0
  140. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/payloadpage.py +0 -0
  141. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/prefilter.py +0 -0
  142. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/profile/README_STARTUP +0 -0
  143. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/profileapp.py +0 -0
  144. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/profiledir.py +0 -0
  145. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/pylabtools.py +0 -0
  146. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/shellapp.py +0 -0
  147. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/splitinput.py +0 -0
  148. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/tbtools.py +0 -0
  149. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/tips.py +0 -0
  150. {ipython-9.17.1 → ipython-9.18.1}/IPython/core/ultratb.py +0 -0
  151. {ipython-9.17.1 → ipython-9.18.1}/IPython/display.py +0 -0
  152. {ipython-9.17.1 → ipython-9.18.1}/IPython/extensions/__init__.py +0 -0
  153. {ipython-9.17.1 → ipython-9.18.1}/IPython/extensions/autoreload.py +0 -0
  154. {ipython-9.17.1 → ipython-9.18.1}/IPython/extensions/deduperreload/__init__.py +0 -0
  155. {ipython-9.17.1 → ipython-9.18.1}/IPython/extensions/deduperreload/deduperreload.py +0 -0
  156. {ipython-9.17.1 → ipython-9.18.1}/IPython/extensions/deduperreload/deduperreload_patching.py +0 -0
  157. {ipython-9.17.1 → ipython-9.18.1}/IPython/extensions/storemagic.py +0 -0
  158. {ipython-9.17.1 → ipython-9.18.1}/IPython/external/__init__.py +0 -0
  159. {ipython-9.17.1 → ipython-9.18.1}/IPython/external/pickleshare.py +0 -0
  160. {ipython-9.17.1 → ipython-9.18.1}/IPython/external/qt_for_kernel.py +0 -0
  161. {ipython-9.17.1 → ipython-9.18.1}/IPython/external/qt_loaders.py +0 -0
  162. {ipython-9.17.1 → ipython-9.18.1}/IPython/lib/__init__.py +0 -0
  163. {ipython-9.17.1 → ipython-9.18.1}/IPython/lib/backgroundjobs.py +0 -0
  164. {ipython-9.17.1 → ipython-9.18.1}/IPython/lib/clipboard.py +0 -0
  165. {ipython-9.17.1 → ipython-9.18.1}/IPython/lib/deepreload.py +0 -0
  166. {ipython-9.17.1 → ipython-9.18.1}/IPython/lib/demo.py +0 -0
  167. {ipython-9.17.1 → ipython-9.18.1}/IPython/lib/editorhooks.py +0 -0
  168. {ipython-9.17.1 → ipython-9.18.1}/IPython/lib/guisupport.py +0 -0
  169. {ipython-9.17.1 → ipython-9.18.1}/IPython/lib/latextools.py +0 -0
  170. {ipython-9.17.1 → ipython-9.18.1}/IPython/lib/lexers.py +0 -0
  171. {ipython-9.17.1 → ipython-9.18.1}/IPython/lib/pretty.py +0 -0
  172. {ipython-9.17.1 → ipython-9.18.1}/IPython/paths.py +0 -0
  173. {ipython-9.17.1 → ipython-9.18.1}/IPython/py.typed +0 -0
  174. {ipython-9.17.1 → ipython-9.18.1}/IPython/sphinxext/__init__.py +0 -0
  175. {ipython-9.17.1 → ipython-9.18.1}/IPython/sphinxext/custom_doctests.py +0 -0
  176. {ipython-9.17.1 → ipython-9.18.1}/IPython/sphinxext/ipython_console_highlighting.py +0 -0
  177. {ipython-9.17.1 → ipython-9.18.1}/IPython/sphinxext/ipython_directive.py +0 -0
  178. {ipython-9.17.1 → ipython-9.18.1}/IPython/sphinxext/tests/__init__.py +0 -0
  179. {ipython-9.17.1 → ipython-9.18.1}/IPython/sphinxext/tests/test_ansi_stripping.py +0 -0
  180. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/__init__.py +0 -0
  181. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/debugger.py +0 -0
  182. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/embed.py +0 -0
  183. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/interactiveshell.py +0 -0
  184. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/ipapp.py +0 -0
  185. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/magics.py +0 -0
  186. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/prompts.py +0 -0
  187. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/pt_inputhooks/__init__.py +0 -0
  188. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/pt_inputhooks/asyncio.py +0 -0
  189. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/pt_inputhooks/glut.py +0 -0
  190. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/pt_inputhooks/gtk.py +0 -0
  191. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/pt_inputhooks/gtk3.py +0 -0
  192. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/pt_inputhooks/gtk4.py +0 -0
  193. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/pt_inputhooks/osx.py +0 -0
  194. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/pt_inputhooks/pyglet.py +0 -0
  195. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/pt_inputhooks/qt.py +0 -0
  196. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/pt_inputhooks/tk.py +0 -0
  197. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/pt_inputhooks/wx.py +0 -0
  198. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/ptutils.py +0 -0
  199. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/shortcuts/__init__.py +0 -0
  200. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/shortcuts/auto_match.py +0 -0
  201. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/shortcuts/auto_suggest.py +0 -0
  202. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/shortcuts/filters.py +0 -0
  203. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/tests/__init__.py +0 -0
  204. {ipython-9.17.1 → ipython-9.18.1}/IPython/terminal/tests/test_ptutils.py +0 -0
  205. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/__init__.py +0 -0
  206. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/decorators.py +0 -0
  207. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/globalipapp.py +0 -0
  208. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/ipunittest.py +0 -0
  209. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/Makefile +0 -0
  210. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/__init__.py +0 -0
  211. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/dtexample.py +0 -0
  212. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/ipdoctest.py +0 -0
  213. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/setup.py +0 -0
  214. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/simple.py +0 -0
  215. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/simplevars.py +0 -0
  216. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/test_combo.txt +0 -0
  217. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/test_example.txt +0 -0
  218. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/test_exampleip.txt +0 -0
  219. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/test_ipdoctest.py +0 -0
  220. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/plugin/test_refs.py +0 -0
  221. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/skipdoctest.py +0 -0
  222. {ipython-9.17.1 → ipython-9.18.1}/IPython/testing/tools.py +0 -0
  223. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/__init__.py +0 -0
  224. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/_process_common.py +0 -0
  225. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/_process_emscripten.py +0 -0
  226. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/_process_posix.py +0 -0
  227. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/_process_win32.py +0 -0
  228. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/capture.py +0 -0
  229. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/coloransi.py +0 -0
  230. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/contexts.py +0 -0
  231. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/data.py +0 -0
  232. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/decorators.py +0 -0
  233. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/dir2.py +0 -0
  234. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/docs.py +0 -0
  235. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/encoding.py +0 -0
  236. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/frame.py +0 -0
  237. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/generics.py +0 -0
  238. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/importstring.py +0 -0
  239. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/io.py +0 -0
  240. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/ipstruct.py +0 -0
  241. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/module_paths.py +0 -0
  242. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/openpy.py +0 -0
  243. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/path.py +0 -0
  244. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/process.py +0 -0
  245. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/sentinel.py +0 -0
  246. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/strdispatch.py +0 -0
  247. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/sysinfo.py +0 -0
  248. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/syspathcontext.py +0 -0
  249. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/tempdir.py +0 -0
  250. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/terminal.py +0 -0
  251. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/timing.py +0 -0
  252. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/tokenutil.py +0 -0
  253. {ipython-9.17.1 → ipython-9.18.1}/IPython/utils/wildcard.py +0 -0
  254. {ipython-9.17.1 → ipython-9.18.1}/LICENSE +0 -0
  255. {ipython-9.17.1 → ipython-9.18.1}/_build_meta.py +0 -0
  256. {ipython-9.17.1 → ipython-9.18.1}/conftest.py +0 -0
  257. {ipython-9.17.1 → ipython-9.18.1}/docs/Makefile +0 -0
  258. {ipython-9.17.1 → ipython-9.18.1}/docs/README.rst +0 -0
  259. {ipython-9.17.1 → ipython-9.18.1}/docs/autogen_api.py +0 -0
  260. {ipython-9.17.1 → ipython-9.18.1}/docs/autogen_config.py +0 -0
  261. {ipython-9.17.1 → ipython-9.18.1}/docs/autogen_magics.py +0 -0
  262. {ipython-9.17.1 → ipython-9.18.1}/docs/autogen_shortcuts.py +0 -0
  263. {ipython-9.17.1 → ipython-9.18.1}/docs/make.cmd +0 -0
  264. {ipython-9.17.1 → ipython-9.18.1}/docs/man/ipython.1 +0 -0
  265. {ipython-9.17.1 → ipython-9.18.1}/docs/modernization_triage_2026-07.md +0 -0
  266. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/2.0/running-crop.png +0 -0
  267. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/2.0/running.png +0 -0
  268. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/2.0/treeview.png +0 -0
  269. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/2.0/user-interface.png +0 -0
  270. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/2.0/widgets.png +0 -0
  271. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/8.0/auto_suggest_1_prompt_no_text.png +0 -0
  272. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/8.0/auto_suggest_2_print_hello_suggest.png +0 -0
  273. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/8.0/auto_suggest_3_print_hello_suggest.png +0 -0
  274. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/8.0/auto_suggest_4_print_hello.png +0 -0
  275. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/8.0/auto_suggest_d_completions.png +0 -0
  276. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/8.0/auto_suggest_d_phantom.png +0 -0
  277. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/8.0/auto_suggest_def_completions.png +0 -0
  278. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/8.0/auto_suggest_def_phantom.png +0 -0
  279. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/8.0/auto_suggest_match_parens.png +0 -0
  280. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/8.0/auto_suggest_second_prompt.png +0 -0
  281. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/8.0/pathlib_pathlib_everywhere.jpg +0 -0
  282. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/autosuggest.gif +0 -0
  283. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipy_013_dashboard.png +0 -0
  284. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipy_013_dashboard_cluster.png +0 -0
  285. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipy_013_notebook_cythonmagic.png +0 -0
  286. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipy_013_notebook_long_out.png +0 -0
  287. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipy_013_notebook_octavemagic.png +0 -0
  288. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipy_013_notebook_rmagic.png +0 -0
  289. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipy_013_notebook_script_cells.png +0 -0
  290. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipy_013_notebook_spectrogram.png +0 -0
  291. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipy_013_notebook_tooltip.png +0 -0
  292. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipy_013_par_tb.png +0 -0
  293. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipy_013_qtconsole_baboon.png +0 -0
  294. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipy_013_qtconsole_completer.png +0 -0
  295. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ipython-6-screenshot.png +0 -0
  296. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/jedi_type_inference_60.png +0 -0
  297. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/kernel_selector_screenshot.png +0 -0
  298. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ms_visual_studio.png +0 -0
  299. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/notebook_specgram.png +0 -0
  300. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/ptshell_features.png +0 -0
  301. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/qtconsole.png +0 -0
  302. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/qtconsole_tabbed.png +0 -0
  303. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_images/unicode_completion.png +0 -0
  304. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_static/favicon.ico +0 -0
  305. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_static/logo.png +0 -0
  306. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_static/theme_overrides.css +0 -0
  307. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_templates/breadcrumbs.html +0 -0
  308. {ipython-9.17.1 → ipython-9.18.1}/docs/source/_templates/notebook_redirect.html +0 -0
  309. {ipython-9.17.1 → ipython-9.18.1}/docs/source/about/history.rst +0 -0
  310. {ipython-9.17.1 → ipython-9.18.1}/docs/source/about/index.rst +0 -0
  311. {ipython-9.17.1 → ipython-9.18.1}/docs/source/api/index.rst +0 -0
  312. {ipython-9.17.1 → ipython-9.18.1}/docs/source/conf.py +0 -0
  313. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/callbacks.rst +0 -0
  314. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/custommagics.rst +0 -0
  315. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/eventloops.rst +0 -0
  316. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/extensions/autoreload.rst +0 -0
  317. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/extensions/index.rst +0 -0
  318. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/extensions/storemagic.rst +0 -0
  319. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/index.rst +0 -0
  320. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/inputtransforms.rst +0 -0
  321. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/integrating.rst +0 -0
  322. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/intro.rst +0 -0
  323. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/options/index.rst +0 -0
  324. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/shell_mimerenderer.rst +0 -0
  325. {ipython-9.17.1 → ipython-9.18.1}/docs/source/config/shortcuts/index.rst +0 -0
  326. {ipython-9.17.1 → ipython-9.18.1}/docs/source/coredev/index.rst +0 -0
  327. {ipython-9.17.1 → ipython-9.18.1}/docs/source/development/config.rst +0 -0
  328. {ipython-9.17.1 → ipython-9.18.1}/docs/source/development/execution.rst +0 -0
  329. {ipython-9.17.1 → ipython-9.18.1}/docs/source/development/figs/ipy_kernel_and_terminal.png +0 -0
  330. {ipython-9.17.1 → ipython-9.18.1}/docs/source/development/figs/ipy_kernel_and_terminal.svg +0 -0
  331. {ipython-9.17.1 → ipython-9.18.1}/docs/source/development/figs/other_kernels.png +0 -0
  332. {ipython-9.17.1 → ipython-9.18.1}/docs/source/development/figs/other_kernels.svg +0 -0
  333. {ipython-9.17.1 → ipython-9.18.1}/docs/source/development/how_ipython_works.rst +0 -0
  334. {ipython-9.17.1 → ipython-9.18.1}/docs/source/development/index.rst +0 -0
  335. {ipython-9.17.1 → ipython-9.18.1}/docs/source/development/kernels.rst +0 -0
  336. {ipython-9.17.1 → ipython-9.18.1}/docs/source/development/messaging.rst +0 -0
  337. {ipython-9.17.1 → ipython-9.18.1}/docs/source/development/wrapperkernels.rst +0 -0
  338. {ipython-9.17.1 → ipython-9.18.1}/docs/source/index.rst +0 -0
  339. {ipython-9.17.1 → ipython-9.18.1}/docs/source/install/index.rst +0 -0
  340. {ipython-9.17.1 → ipython-9.18.1}/docs/source/install/install.rst +0 -0
  341. {ipython-9.17.1 → ipython-9.18.1}/docs/source/install/kernel_install.rst +0 -0
  342. {ipython-9.17.1 → ipython-9.18.1}/docs/source/interactive/index.rst +0 -0
  343. {ipython-9.17.1 → ipython-9.18.1}/docs/source/interactive/magics.rst +0 -0
  344. {ipython-9.17.1 → ipython-9.18.1}/docs/source/interactive/plotting.rst +0 -0
  345. {ipython-9.17.1 → ipython-9.18.1}/docs/source/interactive/python-ipython-diff.rst +0 -0
  346. {ipython-9.17.1 → ipython-9.18.1}/docs/source/interactive/shell.rst +0 -0
  347. {ipython-9.17.1 → ipython-9.18.1}/docs/source/interactive/tips.rst +0 -0
  348. {ipython-9.17.1 → ipython-9.18.1}/docs/source/interactive/tutorial.rst +0 -0
  349. {ipython-9.17.1 → ipython-9.18.1}/docs/source/links.txt +0 -0
  350. {ipython-9.17.1 → ipython-9.18.1}/docs/source/overview.rst +0 -0
  351. {ipython-9.17.1 → ipython-9.18.1}/docs/source/parallel/index.rst +0 -0
  352. {ipython-9.17.1 → ipython-9.18.1}/docs/source/sphinxext.rst +0 -0
  353. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/development.rst +0 -0
  354. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/pr/README.md +0 -0
  355. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/pr/antigravity-feature.rst +0 -0
  356. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/pr/incompat-switching-to-perl.rst +0 -0
  357. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version0.10.rst +0 -0
  358. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version0.8.rst +0 -0
  359. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version0.9.rst +0 -0
  360. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version3_widget_migration.rst +0 -0
  361. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version4.rst +0 -0
  362. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version6.rst +0 -0
  363. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version7.rst +0 -0
  364. {ipython-9.17.1 → ipython-9.18.1}/docs/source/whatsnew/version8.rst +0 -0
  365. {ipython-9.17.1 → ipython-9.18.1}/docs/sphinxext/configtraits.py +0 -0
  366. {ipython-9.17.1 → ipython-9.18.1}/docs/sphinxext/magics.py +0 -0
  367. {ipython-9.17.1 → ipython-9.18.1}/examples/Embedding/embed_class_long.py +0 -0
  368. {ipython-9.17.1 → ipython-9.18.1}/examples/Embedding/embed_class_short.py +0 -0
  369. {ipython-9.17.1 → ipython-9.18.1}/examples/Embedding/embed_function.py +0 -0
  370. {ipython-9.17.1 → ipython-9.18.1}/examples/Embedding/start_ipython_config.py +0 -0
  371. {ipython-9.17.1 → ipython-9.18.1}/examples/IPython Kernel/example-demo.py +0 -0
  372. {ipython-9.17.1 → ipython-9.18.1}/examples/IPython Kernel/gui/gui-glut.py +0 -0
  373. {ipython-9.17.1 → ipython-9.18.1}/examples/IPython Kernel/gui/gui-gtk4.py +0 -0
  374. {ipython-9.17.1 → ipython-9.18.1}/examples/IPython Kernel/gui/gui-qt.py +0 -0
  375. {ipython-9.17.1 → ipython-9.18.1}/examples/IPython Kernel/ipython-completion.bash +0 -0
  376. {ipython-9.17.1 → ipython-9.18.1}/examples/IPython Kernel/ipython-get-history.py +0 -0
  377. {ipython-9.17.1 → ipython-9.18.1}/examples/IPython Kernel/ipython.desktop +0 -0
  378. {ipython-9.17.1 → ipython-9.18.1}/examples/auto_suggest_llm.py +0 -0
  379. {ipython-9.17.1 → ipython-9.18.1}/examples/utils/cwd_prompt.py +0 -0
  380. {ipython-9.17.1 → ipython-9.18.1}/examples/utils/list_pyfiles.ipy +0 -0
  381. {ipython-9.17.1 → ipython-9.18.1}/examples/utils/list_subdirs.ipy +0 -0
  382. {ipython-9.17.1 → ipython-9.18.1}/ipython.egg-info/dependency_links.txt +0 -0
  383. {ipython-9.17.1 → ipython-9.18.1}/ipython.egg-info/entry_points.txt +0 -0
  384. {ipython-9.17.1 → ipython-9.18.1}/ipython.egg-info/not-zip-safe +0 -0
  385. {ipython-9.17.1 → ipython-9.18.1}/ipython.egg-info/top_level.txt +0 -0
  386. {ipython-9.17.1 → ipython-9.18.1}/long_description.rst +0 -0
  387. {ipython-9.17.1 → ipython-9.18.1}/scripts/ipython.ico +0 -0
  388. {ipython-9.17.1 → ipython-9.18.1}/scripts/ipython_nb.ico +0 -0
  389. {ipython-9.17.1 → ipython-9.18.1}/setup.cfg +0 -0
  390. {ipython-9.17.1 → ipython-9.18.1}/setup.py +0 -0
  391. {ipython-9.17.1 → ipython-9.18.1}/setupbase.py +0 -0
  392. {ipython-9.17.1 → ipython-9.18.1}/tests/2x2.jpg +0 -0
  393. {ipython-9.17.1 → ipython-9.18.1}/tests/2x2.png +0 -0
  394. {ipython-9.17.1 → ipython-9.18.1}/tests/__init__.py +0 -0
  395. {ipython-9.17.1 → ipython-9.18.1}/tests/bad_all.py +0 -0
  396. {ipython-9.17.1 → ipython-9.18.1}/tests/conftest.py +0 -0
  397. {ipython-9.17.1 → ipython-9.18.1}/tests/fake_ext_dir/daft_extension.py +0 -0
  398. {ipython-9.17.1 → ipython-9.18.1}/tests/fake_llm.py +0 -0
  399. {ipython-9.17.1 → ipython-9.18.1}/tests/nonascii.py +0 -0
  400. {ipython-9.17.1 → ipython-9.18.1}/tests/nonascii2.py +0 -0
  401. {ipython-9.17.1 → ipython-9.18.1}/tests/print_argv.py +0 -0
  402. {ipython-9.17.1 → ipython-9.18.1}/tests/refbug.py +0 -0
  403. {ipython-9.17.1 → ipython-9.18.1}/tests/simpleerr.py +0 -0
  404. {ipython-9.17.1 → ipython-9.18.1}/tests/tclass.py +0 -0
  405. {ipython-9.17.1 → ipython-9.18.1}/tests/test.wav +0 -0
  406. {ipython-9.17.1 → ipython-9.18.1}/tests/test_alias.py +0 -0
  407. {ipython-9.17.1 → ipython-9.18.1}/tests/test_application.py +0 -0
  408. {ipython-9.17.1 → ipython-9.18.1}/tests/test_autocall.py +0 -0
  409. {ipython-9.17.1 → ipython-9.18.1}/tests/test_backgroundjobs.py +0 -0
  410. {ipython-9.17.1 → ipython-9.18.1}/tests/test_capture.py +0 -0
  411. {ipython-9.17.1 → ipython-9.18.1}/tests/test_clipboard.py +0 -0
  412. {ipython-9.17.1 → ipython-9.18.1}/tests/test_compilerop.py +0 -0
  413. {ipython-9.17.1 → ipython-9.18.1}/tests/test_completerlib.py +0 -0
  414. {ipython-9.17.1 → ipython-9.18.1}/tests/test_contexts.py +0 -0
  415. {ipython-9.17.1 → ipython-9.18.1}/tests/test_crashhandler.py +0 -0
  416. {ipython-9.17.1 → ipython-9.18.1}/tests/test_cve.py +0 -0
  417. {ipython-9.17.1 → ipython-9.18.1}/tests/test_data.py +0 -0
  418. {ipython-9.17.1 → ipython-9.18.1}/tests/test_debug_magic.py +0 -0
  419. {ipython-9.17.1 → ipython-9.18.1}/tests/test_debugger_backport.py +0 -0
  420. {ipython-9.17.1 → ipython-9.18.1}/tests/test_decorators.py +0 -0
  421. {ipython-9.17.1 → ipython-9.18.1}/tests/test_decorators_2.py +0 -0
  422. {ipython-9.17.1 → ipython-9.18.1}/tests/test_deepreload.py +0 -0
  423. {ipython-9.17.1 → ipython-9.18.1}/tests/test_dir2.py +0 -0
  424. {ipython-9.17.1 → ipython-9.18.1}/tests/test_display_functions.py +0 -0
  425. {ipython-9.17.1 → ipython-9.18.1}/tests/test_display_trap.py +0 -0
  426. {ipython-9.17.1 → ipython-9.18.1}/tests/test_displayhook.py +0 -0
  427. {ipython-9.17.1 → ipython-9.18.1}/tests/test_doctb.py +0 -0
  428. {ipython-9.17.1 → ipython-9.18.1}/tests/test_editorhooks.py +0 -0
  429. {ipython-9.17.1 → ipython-9.18.1}/tests/test_embed.py +0 -0
  430. {ipython-9.17.1 → ipython-9.18.1}/tests/test_encoding.py +0 -0
  431. {ipython-9.17.1 → ipython-9.18.1}/tests/test_error.py +0 -0
  432. {ipython-9.17.1 → ipython-9.18.1}/tests/test_events.py +0 -0
  433. {ipython-9.17.1 → ipython-9.18.1}/tests/test_extension.py +0 -0
  434. {ipython-9.17.1 → ipython-9.18.1}/tests/test_frame.py +0 -0
  435. {ipython-9.17.1 → ipython-9.18.1}/tests/test_generics.py +0 -0
  436. {ipython-9.17.1 → ipython-9.18.1}/tests/test_guarded_eval.py +0 -0
  437. {ipython-9.17.1 → ipython-9.18.1}/tests/test_guisupport.py +0 -0
  438. {ipython-9.17.1 → ipython-9.18.1}/tests/test_handlers.py +0 -0
  439. {ipython-9.17.1 → ipython-9.18.1}/tests/test_historyapp.py +0 -0
  440. {ipython-9.17.1 → ipython-9.18.1}/tests/test_imports.py +0 -0
  441. {ipython-9.17.1 → ipython-9.18.1}/tests/test_importstring.py +0 -0
  442. {ipython-9.17.1 → ipython-9.18.1}/tests/test_inputtransformer2_line.py +0 -0
  443. {ipython-9.17.1 → ipython-9.18.1}/tests/test_interactivshell.py +0 -0
  444. {ipython-9.17.1 → ipython-9.18.1}/tests/test_io.py +0 -0
  445. {ipython-9.17.1 → ipython-9.18.1}/tests/test_ipapp.py +0 -0
  446. {ipython-9.17.1 → ipython-9.18.1}/tests/test_iplib.py +0 -0
  447. {ipython-9.17.1 → ipython-9.18.1}/tests/test_ipstruct.py +0 -0
  448. {ipython-9.17.1 → ipython-9.18.1}/tests/test_ipunittest.py +0 -0
  449. {ipython-9.17.1 → ipython-9.18.1}/tests/test_ipython_directive.py +0 -0
  450. {ipython-9.17.1 → ipython-9.18.1}/tests/test_latextools.py +0 -0
  451. {ipython-9.17.1 → ipython-9.18.1}/tests/test_logger.py +0 -0
  452. {ipython-9.17.1 → ipython-9.18.1}/tests/test_logger_unit.py +0 -0
  453. {ipython-9.17.1 → ipython-9.18.1}/tests/test_macro.py +0 -0
  454. {ipython-9.17.1 → ipython-9.18.1}/tests/test_magic_arguments.py +0 -0
  455. {ipython-9.17.1 → ipython-9.18.1}/tests/test_magic_terminal.py +0 -0
  456. {ipython-9.17.1 → ipython-9.18.1}/tests/test_magics_pylab.py +0 -0
  457. {ipython-9.17.1 → ipython-9.18.1}/tests/test_module_paths.py +0 -0
  458. {ipython-9.17.1 → ipython-9.18.1}/tests/test_oinspect.py +0 -0
  459. {ipython-9.17.1 → ipython-9.18.1}/tests/test_openpy.py +0 -0
  460. {ipython-9.17.1 → ipython-9.18.1}/tests/test_page.py +0 -0
  461. {ipython-9.17.1 → ipython-9.18.1}/tests/test_path.py +0 -0
  462. {ipython-9.17.1 → ipython-9.18.1}/tests/test_paths.py +0 -0
  463. {ipython-9.17.1 → ipython-9.18.1}/tests/test_payload.py +0 -0
  464. {ipython-9.17.1 → ipython-9.18.1}/tests/test_pickleshare.py +0 -0
  465. {ipython-9.17.1 → ipython-9.18.1}/tests/test_prefilter.py +0 -0
  466. {ipython-9.17.1 → ipython-9.18.1}/tests/test_pretty.py +0 -0
  467. {ipython-9.17.1 → ipython-9.18.1}/tests/test_process.py +0 -0
  468. {ipython-9.17.1 → ipython-9.18.1}/tests/test_profile.py +0 -0
  469. {ipython-9.17.1 → ipython-9.18.1}/tests/test_pt_inputhooks.py +0 -0
  470. {ipython-9.17.1 → ipython-9.18.1}/tests/test_ptutils.py +0 -0
  471. {ipython-9.17.1 → ipython-9.18.1}/tests/test_pycolorize.py +0 -0
  472. {ipython-9.17.1 → ipython-9.18.1}/tests/test_pylabtools.py +0 -0
  473. {ipython-9.17.1 → ipython-9.18.1}/tests/test_qt_loaders.py +0 -0
  474. {ipython-9.17.1 → ipython-9.18.1}/tests/test_sentinel.py +0 -0
  475. {ipython-9.17.1 → ipython-9.18.1}/tests/test_shellapp.py +0 -0
  476. {ipython-9.17.1 → ipython-9.18.1}/tests/test_shortcuts.py +0 -0
  477. {ipython-9.17.1 → ipython-9.18.1}/tests/test_splitinput.py +0 -0
  478. {ipython-9.17.1 → ipython-9.18.1}/tests/test_storemagic.py +0 -0
  479. {ipython-9.17.1 → ipython-9.18.1}/tests/test_strdispatch.py +0 -0
  480. {ipython-9.17.1 → ipython-9.18.1}/tests/test_sysinfo.py +0 -0
  481. {ipython-9.17.1 → ipython-9.18.1}/tests/test_syspathcontext.py +0 -0
  482. {ipython-9.17.1 → ipython-9.18.1}/tests/test_tempdir.py +0 -0
  483. {ipython-9.17.1 → ipython-9.18.1}/tests/test_terminal_utils.py +0 -0
  484. {ipython-9.17.1 → ipython-9.18.1}/tests/test_text.py +0 -0
  485. {ipython-9.17.1 → ipython-9.18.1}/tests/test_timing.py +0 -0
  486. {ipython-9.17.1 → ipython-9.18.1}/tests/test_tips.py +0 -0
  487. {ipython-9.17.1 → ipython-9.18.1}/tests/test_tokenutil.py +0 -0
  488. {ipython-9.17.1 → ipython-9.18.1}/tests/test_tools.py +0 -0
  489. {ipython-9.17.1 → ipython-9.18.1}/tests/test_ultratb.py +0 -0
  490. {ipython-9.17.1 → ipython-9.18.1}/tests/test_utils_misc.py +0 -0
  491. {ipython-9.17.1 → ipython-9.18.1}/tests/test_utils_terminal.py +0 -0
  492. {ipython-9.17.1 → ipython-9.18.1}/tests/test_wildcard.py +0 -0
@@ -973,6 +973,11 @@ class CompletionSplitter:
973
973
  return self._delim_re.split(cut_line)[-1]
974
974
 
975
975
 
976
+ # keywords which end the expression before them (`x if c else d`, `k in d`),
977
+ # as opposed to the constant keywords which are expressions (`None`, `True`)
978
+ _KEYWORDS_ENDING_EXPRESSION = frozenset(keyword.kwlist) - {"True", "False", "None"}
979
+
980
+
976
981
  class Completer(Configurable):
977
982
 
978
983
  greedy = Bool(
@@ -1265,6 +1270,16 @@ class Completer(Configurable):
1265
1270
  encountered_operator = True
1266
1271
  after_operator = []
1267
1272
  continue
1273
+ elif (
1274
+ t.type == tokenize.NAME
1275
+ and nesting_level == 0
1276
+ and t.string in _KEYWORDS_ENDING_EXPRESSION
1277
+ ):
1278
+ # a keyword (`in`, `else`, `lambda`, `not`, ...) ends the
1279
+ # expression before it just like an operator does
1280
+ encountered_operator = True
1281
+ after_operator = []
1282
+ continue
1268
1283
 
1269
1284
  if encountered_operator:
1270
1285
  after_operator.append(t.string)
@@ -1293,19 +1308,20 @@ class Completer(Configurable):
1293
1308
  except tokenize.TokenError:
1294
1309
  pass
1295
1310
 
1296
- obj = self._evaluate_expr(expr)
1297
- if obj is not_found:
1298
- if context:
1299
- # try to evaluate on full buffer
1300
- previous_lines = "\n".join(
1301
- context.full_text.split("\n")[: context.cursor_line]
1311
+ obj = not_found
1312
+ if context:
1313
+ # try to evaluate on full buffer
1314
+ previous_lines = "\n".join(
1315
+ context.full_text.split("\n")[: context.cursor_line]
1316
+ )
1317
+ if previous_lines:
1318
+ all_code_lines_before_cursor = (
1319
+ self._extract_code(previous_lines) + "\n" + expr
1302
1320
  )
1303
- if previous_lines:
1304
- all_code_lines_before_cursor = (
1305
- self._extract_code(previous_lines) + "\n" + expr
1306
- )
1307
- obj = self._evaluate_expr(all_code_lines_before_cursor)
1321
+ obj = self._evaluate_expr(all_code_lines_before_cursor)
1308
1322
 
1323
+ if obj is not_found:
1324
+ obj = self._evaluate_expr(expr)
1309
1325
  if obj is not_found:
1310
1326
  return [], ""
1311
1327
 
@@ -2617,8 +2633,11 @@ class IPCompleter(Completer):
2617
2633
  if is_string and not is_in_expression:
2618
2634
  return self._CompletionContextType.GLOBAL
2619
2635
 
2620
- # If we're in a template string expression, handle specially
2621
- if is_string and is_in_expression:
2636
+ # If we're in a template string expression, handle specially.
2637
+ # Note that ``is_string`` may be False here for nested template strings
2638
+ # (``f'{f'a.``) as the naive quote tracking sees the inner opening quote
2639
+ # as closing the outer one; the recursion below sorts this out.
2640
+ if is_in_expression:
2622
2641
  # Extract the expression part - look for the last { that isn't closed
2623
2642
  expr_start = line.rfind("{")
2624
2643
  if expr_start >= 0:
@@ -2633,12 +2652,119 @@ class IPCompleter(Completer):
2633
2652
  return self._CompletionContextType.GLOBAL
2634
2653
 
2635
2654
  # Handle all other attribute matches np.ran, d[0].k, (a,b).count, obj._private
2636
- chain_match = re.search(r".*(.+(?<!\s)\.(?:[a-zA-Z_]\w*)?)$", line)
2637
- if chain_match:
2638
- return self._CompletionContextType.ATTRIBUTE
2655
+ # A trailing dot is only an attribute access if what precedes it is a
2656
+ # valid Python expression; malformed input such as ``3a.`` or ``$).``
2657
+ # is not, and falls back to global completion.
2658
+ target = self._extract_attribute_target(line)
2659
+ if target is not None:
2660
+ try:
2661
+ ast.parse(target, mode="eval")
2662
+ except (SyntaxError, ValueError):
2663
+ pass
2664
+ else:
2665
+ return self._CompletionContextType.ATTRIBUTE
2639
2666
 
2640
2667
  return self._CompletionContextType.GLOBAL
2641
2668
 
2669
+ def _extract_attribute_target(self, line: str) -> str | None:
2670
+ """Extract the expression a trailing ``.attr`` would be looked up on.
2671
+
2672
+ Scan *line* backwards from the last dot (which must be followed by at
2673
+ most an identifier and nothing else) and return the primary expression
2674
+ preceding it, or ``None`` if there is no trailing attribute access or
2675
+ no plausible expression in front of it.
2676
+ """
2677
+ match = re.search(r"\.(?:[a-zA-Z_]\w*)?$", line)
2678
+ if match is None:
2679
+ return None
2680
+ dot = match.start()
2681
+ i = dot - 1
2682
+ while i >= 0:
2683
+ char = line[i]
2684
+ if char in ")]":
2685
+ # A call or subscript trailer, or a parenthesized/list atom;
2686
+ # whatever precedes it may still be part of the expression.
2687
+ i = self._skip_backwards_over_brackets(line, i)
2688
+ if i is None:
2689
+ return None
2690
+ continue
2691
+ if char == "}":
2692
+ # A dict/set display; nothing may precede it.
2693
+ i = self._skip_backwards_over_brackets(line, i)
2694
+ if i is None:
2695
+ return None
2696
+ break
2697
+ if char in "\"'":
2698
+ # A string literal; nothing but its prefix may precede it.
2699
+ i = self._skip_backwards_over_string(line, i)
2700
+ if i is None:
2701
+ return None
2702
+ break
2703
+ if char.isalnum() or char == "_":
2704
+ while i >= 0 and (line[i].isalnum() or line[i] == "_"):
2705
+ i -= 1
2706
+ # a name or number may itself be an attribute of something else
2707
+ if i >= 0 and line[i] == ".":
2708
+ i -= 1
2709
+ continue
2710
+ break
2711
+ # anything else (operator, bracket, whitespace, ...) ends the
2712
+ # expression
2713
+ break
2714
+ return line[i + 1 : dot] or None
2715
+
2716
+ def _skip_backwards_over_brackets(self, line: str, i: int) -> int | None:
2717
+ """Skip a bracketed group ending at index *i* (a closing bracket).
2718
+
2719
+ Return the index just before the matching opening bracket, or ``None``
2720
+ if the brackets are unbalanced.
2721
+ """
2722
+ depth = 0
2723
+ while i >= 0:
2724
+ char = line[i]
2725
+ if char in "\"'":
2726
+ skipped = self._skip_backwards_over_string(line, i)
2727
+ if skipped is None:
2728
+ return None
2729
+ i = skipped
2730
+ continue
2731
+ if char in ")]}":
2732
+ depth += 1
2733
+ elif char in "([{":
2734
+ depth -= 1
2735
+ if depth == 0:
2736
+ return i - 1
2737
+ if depth < 0:
2738
+ return None
2739
+ i -= 1
2740
+ return None
2741
+
2742
+ def _skip_backwards_over_string(self, line: str, i: int) -> int | None:
2743
+ """Skip a string literal ending at index *i* (its closing quote).
2744
+
2745
+ Return the index just before the opening quote (and any string prefix),
2746
+ or ``None`` if no opening quote was found.
2747
+ """
2748
+ quote = line[i]
2749
+ j = i - 1
2750
+ while j >= 0:
2751
+ if line[j] == quote:
2752
+ backslashes = 0
2753
+ k = j - 1
2754
+ while k >= 0 and line[k] == "\\":
2755
+ backslashes += 1
2756
+ k -= 1
2757
+ if backslashes % 2 == 0:
2758
+ break
2759
+ j -= 1
2760
+ else:
2761
+ return None
2762
+ j -= 1
2763
+ # skip any string prefix (r, b, u, f, t and combinations thereof)
2764
+ while j >= 0 and line[j] in "bBrRuUfFtT":
2765
+ j -= 1
2766
+ return j
2767
+
2642
2768
  def _is_completing_in_cli_context(self, text: str) -> bool:
2643
2769
  """
2644
2770
  Determine if we are completing in a CLI alias, line magic, or bang expression context.
@@ -2991,11 +3117,23 @@ class IPCompleter(Completer):
2991
3117
 
2992
3118
  usedNamedArgs.add(token)
2993
3119
 
3120
+ from IPython.core.guarded_eval import EvaluationContext, guarded_eval
3121
+
2994
3122
  argMatches = []
2995
3123
  try:
2996
3124
  callableObj = '.'.join(ids[::-1])
2997
- namedArgs = self._default_arguments(eval(callableObj,
2998
- self.namespace))
3125
+ namedArgs = self._default_arguments(
3126
+ guarded_eval(
3127
+ callableObj,
3128
+ EvaluationContext(
3129
+ globals=self.global_namespace,
3130
+ locals=self.namespace,
3131
+ evaluation=self.evaluation,
3132
+ auto_import=self._auto_import,
3133
+ policy_overrides=self.policy_overrides,
3134
+ ),
3135
+ )
3136
+ )
2999
3137
 
3000
3138
  # Remove used named arguments from the list, no need to show twice
3001
3139
  for namedArg in set(namedArgs) - usedNamedArgs:
@@ -3058,7 +3196,20 @@ class IPCompleter(Completer):
3058
3196
 
3059
3197
  expr, prior_tuple_keys, key_prefix = match.groups()
3060
3198
 
3061
- obj = self._evaluate_expr(expr)
3199
+ # the regular expression captures everything before the bracket.
3200
+ # Only the expression after the last operator or keyword is subscripted.
3201
+ try:
3202
+ stripped_expr = self._strip_code_before_operator(expr)
3203
+ except tokenize.TokenError:
3204
+ stripped_expr = expr
3205
+
3206
+ obj = self._evaluate_expr(stripped_expr)
3207
+
3208
+ if obj is not_found and stripped_expr != expr:
3209
+ # stripping joins tokens that were separated by whitespace, so
3210
+ # `%timeit d` becomes `timeitd`, which `_evaluate_expr` does not
3211
+ # trim because it is a valid name rather than a syntax error
3212
+ obj = self._evaluate_expr(expr)
3062
3213
 
3063
3214
  if obj is not_found:
3064
3215
  return []
@@ -540,7 +540,7 @@ class ProgressBar(DisplayObject):
540
540
  self._display_id = hexlify(os.urandom(8)).decode('ascii')
541
541
 
542
542
  def __repr__(self):
543
- fraction = self.progress / self.total
543
+ fraction = self.progress / self.total if self.total else 0
544
544
  filled = '=' * int(fraction * self.text_width)
545
545
  rest = ' ' * (self.text_width - len(filled))
546
546
  return '[{}{}] {}/{}'.format(
@@ -832,18 +832,21 @@ def _webpxy(data):
832
832
  """read the (width, height) from a WEBP header"""
833
833
  import struct
834
834
  if data[12:16] == b"VP8 ":
835
- width, height = struct.unpack("<HH", data[24:30])
835
+ # lossy: 14 bits each, after the frame tag and the start code
836
+ width, height = struct.unpack("<HH", data[26:30])
836
837
  width = width & 0x3FFF
837
838
  height = height & 0x3FFF
838
839
  return (width, height)
839
840
  elif data[12:16] == b"VP8L":
841
+ # lossless: 14 bits each of (width - 1, height - 1), after the signature
840
842
  size_info = struct.unpack("<I", data[21:25])[0]
841
- width = 1 + ((size_info & 0x3F) << 8) | (size_info >> 24)
842
- height = 1 + (
843
- (((size_info >> 8) & 0xF) << 10)
844
- | (((size_info >> 14) & 0x3FC) << 2)
845
- | ((size_info >> 22) & 0x3)
846
- )
843
+ width = 1 + (size_info & 0x3FFF)
844
+ height = 1 + ((size_info >> 14) & 0x3FFF)
845
+ return (width, height)
846
+ elif data[12:16] == b"VP8X":
847
+ # extended: 24 bits each of (canvas width - 1, canvas height - 1)
848
+ width = 1 + int.from_bytes(data[24:27], "little")
849
+ height = 1 + int.from_bytes(data[27:30], "little")
847
850
  return (width, height)
848
851
  else:
849
852
  raise ValueError("Not a valid WEBP header")
@@ -863,7 +866,7 @@ class ImageFormat(_ImageFormat, Enum):
863
866
  jpeg = (b"\xff\xd8",), _jpegxy
864
867
  jpg = jpeg # alias, has `.name == "jpeg"`
865
868
  gif = (b"GIF87a", b"GIF89a"), _gifxy
866
- webp = (b"WEBP",), _webpxy
869
+ webp = (b"RIFF",), _webpxy
867
870
 
868
871
  @property
869
872
  def mime_type(self):
@@ -874,6 +877,10 @@ class ImageFormat(_ImageFormat, Enum):
874
877
  for fmt in cls:
875
878
  for magic in fmt.magics:
876
879
  if data.startswith(magic):
880
+ # RIFF is a generic container (WAV, AVI, ...), WEBP files
881
+ # are identified by the form type after the size field.
882
+ if fmt is cls.webp and data[8:12] != b"WEBP":
883
+ continue
877
884
  return fmt
878
885
  return None
879
886
 
@@ -914,7 +921,8 @@ class Image(DisplayObject):
914
921
 
915
922
  filename : unicode
916
923
  Path to a local file to load the data from.
917
- Images from a file are always embedded.
924
+ Images from a file are embedded unless you specify `embed=False`,
925
+ in which case the path is used as the image source.
918
926
 
919
927
  format : unicode
920
928
  The format of the image data (png/jpeg/jpg/gif/webp). If a filename or URL is given
@@ -1066,8 +1074,9 @@ class Image(DisplayObject):
1066
1074
  klass = ' class="unconfined"'
1067
1075
  if self.alt:
1068
1076
  alt = ' alt="%s"' % html.escape(self.alt)
1077
+ url = self.url if self.url is not None else self.filename
1069
1078
  return '<img src="{url}"{width}{height}{klass}{alt}/>'.format(
1070
- url=html.escape(self.url or ""),
1079
+ url=html.escape(url or ""),
1071
1080
  width=width,
1072
1081
  height=height,
1073
1082
  klass=klass,
@@ -221,8 +221,13 @@ class DisplayHook(Configurable):
221
221
  for unders in ['_'*i for i in range(1,4)]:
222
222
  if unders not in self.shell.user_ns:
223
223
  continue
224
- if getattr(self, unders) is not self.shell.user_ns.get(unders):
225
- update_unders = False
224
+ user_value = self.shell.user_ns[unders]
225
+ if unders in self.shell.user_ns_hidden:
226
+ if self.shell.user_ns_hidden[unders] is user_value:
227
+ continue
228
+ elif getattr(self, unders) is user_value:
229
+ continue
230
+ update_unders = False
226
231
 
227
232
  self.___ = self.__
228
233
  self.__ = self._
@@ -29,7 +29,7 @@ We can now define our own formatter and register it:
29
29
 
30
30
  >>> llm_formatter = LLMFormatter(parent=ip.display_formatter)
31
31
 
32
- >>> ip.display_formatter.formatters[LLMFormatter.format_type] = llm_formatter
32
+ >>> ip.display_formatter.register_formatter(llm_formatter)
33
33
 
34
34
  Now any class that define `_repr_llm_` will return a x-vendor/llm as part of
35
35
  it's display data:
@@ -144,6 +144,14 @@ class DisplayFormatter(Configurable):
144
144
  d[f.format_type] = f
145
145
  return d
146
146
 
147
+ def register_formatter(self, formatter):
148
+ if formatter.format_type in self.formatters:
149
+ warnings.warn(
150
+ f"Replacing formatter {type(self.formatters[formatter.format_type])} with {type(formatter)}",
151
+ FormatterWarning,
152
+ )
153
+ self.formatters[formatter.format_type] = formatter
154
+
147
155
  def format(self, obj, include=None, exclude=None):
148
156
  """Return a format data dict for an object.
149
157
 
@@ -234,7 +234,7 @@ class HistoryAccessorBase(LoggingConfigurable):
234
234
 
235
235
  def get_tail(
236
236
  self,
237
- n: int = 10,
237
+ n: int | None = 10,
238
238
  raw: bool = True,
239
239
  output: bool = False,
240
240
  include_latest: bool = False,
@@ -541,7 +541,7 @@ class HistoryAccessor(HistoryAccessorBase):
541
541
  @catch_corrupt_db
542
542
  def get_tail(
543
543
  self,
544
- n: int = 10,
544
+ n: int | None = 10,
545
545
  raw: bool = True,
546
546
  output: bool = False,
547
547
  include_latest: bool = False,
@@ -550,8 +550,9 @@ class HistoryAccessor(HistoryAccessorBase):
550
550
 
551
551
  Parameters
552
552
  ----------
553
- n : int
554
- The number of lines to get
553
+ n : int or None
554
+ The number of lines to get. None gets the default of 10, which a
555
+ kernel ``history_request`` without ``n`` asks for.
555
556
  raw, output : bool
556
557
  See :meth:`get_range`
557
558
  include_latest : bool
@@ -563,6 +564,8 @@ class HistoryAccessor(HistoryAccessorBase):
563
564
  -------
564
565
  Tuples as :meth:`get_range`
565
566
  """
567
+ if n is None:
568
+ n = 10
566
569
  self.writeout_cache()
567
570
  if not include_latest:
568
571
  n += 1
@@ -966,7 +969,7 @@ class HistoryManager(HistoryAccessor):
966
969
  @catch_corrupt_db
967
970
  def get_tail(
968
971
  self,
969
- n: int = 10,
972
+ n: int | None = 10,
970
973
  raw: bool = True,
971
974
  output: bool = False,
972
975
  include_latest: bool = False,
@@ -980,8 +983,9 @@ class HistoryManager(HistoryAccessor):
980
983
 
981
984
  Parameters
982
985
  ----------
983
- n : int
984
- The number of lines to get
986
+ n : int or None
987
+ The number of lines to get. None gets the default of 10, which a
988
+ kernel ``history_request`` without ``n`` asks for.
985
989
  raw, output : bool
986
990
  See :meth:`get_range`
987
991
  include_latest : bool
@@ -993,6 +997,8 @@ class HistoryManager(HistoryAccessor):
993
997
  -------
994
998
  Tuples as :meth:`get_range`
995
999
  """
1000
+ if n is None:
1001
+ n = 10
996
1002
  self.writeout_cache()
997
1003
  if not include_latest:
998
1004
  n += 1
@@ -55,12 +55,27 @@ __all__ = [
55
55
  "clipboard_get",
56
56
  ]
57
57
 
58
+
59
+ def _quote_if_needed(path):
60
+ """Wrap path in double quotes if it contains spaces and isn't already quoted."""
61
+ if " " in path and not (path.startswith('"') and path.endswith('"')):
62
+ return '"%s"' % path
63
+ return path
64
+
65
+
58
66
  def editor(self, filename, linenum=None, wait=True):
59
67
  """Open the default editor at the given filename and linenumber.
60
68
 
61
69
  This is IPython's default editor hook, you can use it as an example to
62
70
  write your own modified one. To set your own editor function as the
63
- new editor hook, call ip.set_hook('editor',yourfunc)."""
71
+ new editor hook, call ip.set_hook('editor',yourfunc).
72
+
73
+ Notes
74
+ -----
75
+ `filename` is always passed in raw/unquoted form. Any quoting or
76
+ escaping needed to safely build a shell command is the responsibility
77
+ of the hook implementation, not the caller.
78
+ """
64
79
 
65
80
  # IPython configures a default editor at startup by reading $EDITOR from
66
81
  # the environment, and falling back on vi (unix) or notepad (win32).
@@ -73,8 +88,9 @@ def editor(self, filename, linenum=None, wait=True):
73
88
  linemark = '+%d' % int(linenum)
74
89
 
75
90
  # Enclose in quotes if necessary and legal
76
- if ' ' in editor and os.path.isfile(editor) and editor[0] != '"':
77
- editor = '"%s"' % editor
91
+ if os.path.isfile(editor):
92
+ editor = _quote_if_needed(editor)
93
+ filename = _quote_if_needed(filename)
78
94
 
79
95
  # Call the actual editor
80
96
  import subprocess
@@ -663,9 +663,12 @@ def make_tokens_by_line(lines: list[str]):
663
663
  tokens_by_line[-1].append(token)
664
664
  if (token.type == NEWLINE) or ((token.type == NL) and (parenlev <= 0)):
665
665
  tokens_by_line.append([])
666
- elif token.string in {"(", "[", "{"}:
666
+ elif token.type == tokenize.OP and token.string in {"(", "[", "{"}:
667
+ # Only OP tokens are real brackets; e.g. on Python 3.12+
668
+ # FSTRING_MIDDLE tokens may contain bracket characters as
669
+ # literal text (refs #15436).
667
670
  parenlev += 1
668
- elif token.string in {")", "]", "}"}:
671
+ elif token.type == tokenize.OP and token.string in {")", "]", "}"}:
669
672
  if parenlev > 0:
670
673
  parenlev -= 1
671
674
  except tokenize.TokenError:
@@ -682,9 +685,12 @@ def has_sunken_brackets(tokens: list[tokenize.TokenInfo]):
682
685
  """Check if the depth of brackets in the list of tokens drops below 0"""
683
686
  parenlev = 0
684
687
  for token in tokens:
685
- if token.string in {"(", "[", "{"}:
688
+ # Only OP tokens are real brackets; e.g. on Python 3.12+
689
+ # FSTRING_MIDDLE tokens may contain bracket characters as
690
+ # literal text (refs #15436).
691
+ if token.type == tokenize.OP and token.string in {"(", "[", "{"}:
686
692
  parenlev += 1
687
- elif token.string in {")", "]", "}"}:
693
+ elif token.type == tokenize.OP and token.string in {")", "]", "}"}:
688
694
  parenlev -= 1
689
695
  if parenlev < 0:
690
696
  return True
@@ -2,10 +2,15 @@
2
2
 
3
3
  from base64 import b64encode, b64decode
4
4
  from collections.abc import Iterator
5
+ import logging
5
6
  import os
6
7
  import sys
7
8
  import warnings
8
9
 
10
+ #: Module logger ``IPython.core.kitty``
11
+ #: We don't have a global logger so let's use a module leveled one.
12
+ _log = logging.getLogger(__name__)
13
+
9
14
  #: Set ``IPYTHON_KITTY_GRAPHICS`` to ``1``/``true`` or ``0``/``false`` to state
10
15
  #: outright whether the terminal speaks the kitty graphics protocol. Unset (or
11
16
  #: empty) autodetects. Forcing it also skips the detection itself, which walks
@@ -71,11 +76,18 @@ def _proc_ancestor_names() -> Iterator[str]:
71
76
 
72
77
  def _psutil_ancestor_names() -> Iterator[str]:
73
78
  """Yield ancestor process names, nearest first, using psutil."""
74
- import psutil
79
+ try:
80
+ import psutil
81
+ except ImportError as exc_import:
82
+ _log.error(
83
+ "Cannot import `psutil`(%s). Image rendering is disabled.", exc_import
84
+ )
85
+ return
75
86
 
76
87
  try:
77
88
  process = psutil.Process()
78
- while process := process.parent():
89
+ while (parent := process.parent()) is not None:
90
+ process = parent
79
91
  yield process.name()
80
92
  except (psutil.Error, OSError):
81
93
  # Walking the process tree can fail when /proc is mounted with
@@ -97,7 +109,7 @@ def _ancestor_process_names() -> Iterator[str]:
97
109
  Everywhere else -- macOS, or a Linux without ``/proc`` -- fall back to
98
110
  psutil, which IPython depends on anyway.
99
111
  """
100
- if sys.platform == "linux" and os.path.isdir("/proc/self"):
112
+ if sys.platform in ("linux", "android") and os.path.isdir("/proc/self"):
101
113
  yield from _proc_ancestor_names()
102
114
  else:
103
115
  yield from _psutil_ancestor_names()
@@ -108,7 +120,13 @@ def _supports_kitty_graphics() -> bool:
108
120
  if forced is not None:
109
121
  return forced
110
122
 
111
- if sys.platform not in ("darwin", "linux"):
123
+ # Platforms including "android" can actually run shells like kitty and
124
+ # render images. See also
125
+ # https://github.com/ipython/ipython/issues/15422 .
126
+ # Thus, instead of a whitelist, let's build a blacklist.
127
+ # Make the linter happy. A tuple includes platform names should be placed
128
+ # here.
129
+ if sys.platform == "win32":
112
130
  return False
113
131
 
114
132
  isatty = getattr(sys.stdout, "isatty", None)
@@ -130,7 +148,16 @@ def _supports_kitty_graphics() -> bool:
130
148
  return any(name in supported_terminals for name in _ancestor_process_names())
131
149
 
132
150
 
133
- supports_kitty_graphics = _supports_kitty_graphics()
151
+ def __getattr__(name: str) -> bool:
152
+ """Lazily re-expose ``supports_kitty_graphics`` as a public alias.
153
+
154
+ Its import-time evaluation was dropped in b7a63205 to keep process-tree
155
+ walks out of startup; downstream code (e.g. sagemath) still imports the
156
+ name, so compute it on access instead (#15460).
157
+ """
158
+ if name == "supports_kitty_graphics":
159
+ return _supports_kitty_graphics()
160
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
134
161
 
135
162
 
136
163
  def png_to_kitty_ansi(png: bytes) -> str:
@@ -162,9 +189,11 @@ def kitty_png_render(png: bytes | str, _md_dict: object) -> None:
162
189
 
163
190
  display_formatter_default_active_types = [
164
191
  "text/plain",
165
- *(["image/png"] if supports_kitty_graphics else []),
166
192
  ]
167
193
 
168
194
  terminal_default_mime_renderers = {
169
- "image/png": kitty_png_render,
170
195
  }
196
+
197
+ if _supports_kitty_graphics():
198
+ display_formatter_default_active_types.append("image/png")
199
+ terminal_default_mime_renderers["image/png"] = kitty_png_render