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

Skip to content

Commit d4e40e0

Browse files
committed
Inline and remove only usage of on_off
Closes #15129
1 parent f4520de commit d4e40e0

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

IPython/core/magic.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ class Bunch:
6464
pass
6565

6666

67-
def on_off(tag: int) -> str:
68-
"""Return an ON/OFF string for a 1/0 input. Simple utility function."""
69-
return ["OFF", "ON"][tag]
70-
71-
7267
def compress_dhist(dh: list[str]) -> list[str]:
7368
"""Compress a directory history into a new one with at most 20 entries.
7469

IPython/core/magics/execution.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
magics_class,
5454
needs_local_scope,
5555
no_var_expand,
56-
on_off,
5756
output_can_be_silenced,
5857
)
5958
from IPython.testing.skipdoctest import skip_doctest
@@ -434,7 +433,7 @@ def pdb(self, parameter_s=''):
434433

435434
# set on the shell
436435
self.shell.call_pdb = new_pdb
437-
print("Automatic pdb calling has been turned", on_off(new_pdb))
436+
print("Automatic pdb calling has been turned", "ON" if new_pdb else "OFF")
438437

439438
@magic_arguments.magic_arguments()
440439
@magic_arguments.argument('--breakpoint', '-b', metavar='FILE:LINE',

0 commit comments

Comments
 (0)