Commit message Age Author Refs
r28314:cf7c2664
back to dev
Matthias Bussonnier
0
r28313:f1127642
release 8.14.0
Matthias Bussonnier
0
r28312:a3ede0d8
whats new 8.14 (#14092)
Matthias Bussonnier
0
r28311:97477f43
whats new 8.14
Matthias Bussonnier
0
r28310:ee0bc157
Add option to EventManager to prevent printing (#14076) I would love to be able to turn off this print statement as it regularly get in the way of nice error formatting.
Matthias Bussonnier
0
r28309:1d4e1847
Display exception notes in tracebacks (#14039) [PEP 678](https://peps.python.org/pep-0678/) introduced the ability to add notes to exception objects. This has been [released in Python 3.11](https://docs.python.org/3/library/exceptions.html#BaseException.add_note) and is currently not implemented in IPython. These changes are fully compatible with older Python versions that don't include PEP 678. Here's a sample test that shows the consistency in Python's stdlib traceback module (test 1) and the difference between Python and IPython's runtimes (test 2): ```python import traceback print('--- test 1 ---') try: raise Exception('Testing notes') except Exception as e: e.add_note('Does this work?') e.add_note('Yes!') traceback.print_exc() print('\n--- test 2 ---') try: raise Exception('Testing notes') except Exception as e: e.add_note('Does this work?') e.add_note('No!') raise ``` When executed with Python 3.11, both notes are displayed in both tracebacks: ``` $ python test.py --- test 1 --- Traceback (most recent call last): File "/app/test.py", line 5, in <module> raise Exception('Testing notes') Exception: Testing notes Does this work? Yes! --- test 2 --- Traceback (most recent call last): File "/app/test.py", line 13, in <module> raise Exception('Testing notes') Exception: Testing notes Does this work? No! ``` In IPython's VerboseTB does not yet handle exception notes: ``` $ ipython test.py --- test 1 --- Traceback (most recent call last): File "/app/test.py", line 5, in <module> raise Exception('Testing notes') Exception: Testing notes Does this work? Yes! --- test 2 --- --------------------------------------------------------------------------- Exception Traceback (most recent call last) File /app/test.py:13 11 print('\n--- test 2 ---') 12 try: ---> 13 raise Exception('Testing notes') 14 except Exception as e: 15 e.add_note('Does this work?') Exception: Testing notes ``` The changes I am suggesting are inspired from implementation of [Lib/traceback.py](https://github.com/python/cpython/blob/main/Lib/traceback.py) (search for `__notes__`) and improvements for dealing with edge cases more nicely in [cpython#103897](https://github.com/python/cpython/pull/103897). Although notes are meant to be strings only, I kept some inspiration from the existing exception handling to ensure that the notes are uncolored and bytes decoded, if there are any. I am definitely open to using a different color if deemed better. For context, `bpython` keeps the notes uncolored, and [Python's tutorial](https://docs.python.org/3/tutorial/errors.html#enriching-exceptions-with-notes) puts them in light gray, like the line numbers. Here's how the test 2 looks like after these changes: ![image](https://user-images.githubusercontent.com/16963011/234723689-6bbfe0ff-94d4-4a90-9da6-acfe1c8e5edf.png) ## :snake: :man_juggling:
Matthias Bussonnier
0
r28308:19c7bb1a
Add option to EventManager to prevent printing
Tim Nonet
0
r28307:3a567f0e
Use module and method descriptor types declared in the `types` module (#14055) Fixes #14041.
Matthias Bussonnier
0
r28306:b518e6a5
Add option to `%autoreload` to hide errors when reloading code (#14056) * We have `%autoreload` enabled by default in Spyder and think it's a bit annoying to show its error messages to users because they make little sense to them. These errors are not uncommon when you are working with some code that is slightly different between two git branches. * However, I didn't change the current behavior (i.e. showing errors) because it's been like that for as long as I can remember. We'd simply use the new `--hide-errors` option in our kernel.
Matthias Bussonnier
0
r28305:61fc0aba
Add pass-through filter for shortcuts (#14080) This is one way to fix https://github.com/ipython/ipython/issues/14070. The alternatives are: - try to change upstream prompt-toolkit to fire all matching keybindings, not only the last one [as it does currently](https://github.com/prompt-toolkit/python-prompt-toolkit/blob/07412a37b38dd70a3d63f2966a21f0a645133264/src/prompt_toolkit/key_binding/key_processor.py#L187) - this would be breaking so we would need to wait for a major release if this would be accepted - _unless_ instead of firing all matching keybindings only keybindings which oped in via a flag would be additionally fired (there is a precedent of `eager` flag) - add a tailored function with logic that figures out what to do based on state of application - I am not a fan of this as these are hard to test already.
Matthias Bussonnier
0
< 1 2 3 4 5 6 7 .. 2832 >