Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bd310ed

Browse files
authored
Create a new xmode "Docs" (#14752)
This is a compact mode with a minimal header and no traceback, mosttly to be used in Documentation, where the context of the traceback is rarely useful ``` $ ipython --InteractiveShell.xmode=Docs In [1]: import pywt ...: ...: a = pywt.idwt([1,2,3,4,5], [1,2,3,4], 'db2' ,'symmetric') ...: ...: print(a) Traceback (most recent call last): Cell In[1], line 3 -> a = pywt.idwt([1,2,3,4,5], [1,2,3,4], 'db2' ,'symmetric') [... 3 skipped frames] ValueError: Coefficients arrays must have the same size. ```
2 parents bf0caef + 03f4495 commit bd310ed

61 files changed

Lines changed: 1155 additions & 647 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

IPython/core/alias.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ class AliasError(Exception):
120120
class InvalidAliasError(AliasError):
121121
pass
122122

123-
class Alias(object):
123+
124+
class Alias:
124125
"""Callable object storing the details of one alias.
125126
126127
Instances are registered as magic functions to allow use of aliases.

IPython/core/autocall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# Code
2929
#-----------------------------------------------------------------------------
3030

31-
class IPyAutocall(object):
31+
class IPyAutocall:
3232
""" Instances of this class are always autocalled
3333
3434
This happens regardless of 'autocall' variable state. Use this to

IPython/core/builtin_trap.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@
1010
from traitlets import Instance
1111

1212

13-
class __BuiltinUndefined(object): pass
13+
class __BuiltinUndefined:
14+
pass
15+
16+
1417
BuiltinUndefined = __BuiltinUndefined()
1518

16-
class __HideBuiltin(object): pass
19+
20+
class __HideBuiltin:
21+
pass
22+
23+
1724
HideBuiltin = __HideBuiltin()
1825

1926

IPython/core/completer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ def rectify_completions(text: str, completions: _IC, *, _debug: bool = False) ->
904904
GREEDY_DELIMS = ' =\r\n'
905905

906906

907-
class CompletionSplitter(object):
907+
class CompletionSplitter:
908908
"""An object to split an input line in a manner similar to readline.
909909
910910
By having our own implementation, we can expose readline-like completion in

IPython/core/display.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def display_pdf(*objs, **kwargs):
287287
#-----------------------------------------------------------------------------
288288

289289

290-
class DisplayObject(object):
290+
class DisplayObject:
291291
"""An object that wraps data to be displayed."""
292292

293293
_read_flags = 'r'

IPython/core/display_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def update_display(obj, *, display_id, **kwargs):
306306
display(obj, display_id=display_id, **kwargs)
307307

308308

309-
class DisplayHandle(object):
309+
class DisplayHandle:
310310
"""A handle on an updatable display
311311
312312
Call `.update(obj)` to display a new object.

IPython/core/displayhook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def flush(self):
322322
gc.collect()
323323

324324

325-
class CapturingDisplayHook(object):
325+
class CapturingDisplayHook:
326326
def __init__(self, shell, outputs=None):
327327
self.shell = shell
328328
if outputs is None:

0 commit comments

Comments
 (0)