GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — allow_none=False by default for Type and Instance · dhrits/ipython@4c8e425

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • IPython
    • config
      • application.py
      • configurable.py
    • core
      • alias.py
      • application.py
      • builtin_trap.py
      • displayhook.py
      • extensions.py
      • history.py
      • interactiveshell.py
      • magic.py
      • prefilter.py
      • prompts.py
      • shellapp.py
    • html
      • notebookapp.py
      • services/clusters
        • clustermanager.py
      • widgets
        • widget.py
    • kernel
      • inprocess
        • client.py
        • ipkernel.py
        • manager.py
      • ioloop
        • manager.py
        • restarter.py
      • zmq
        • datapub.py
        • displayhook.py
        • ipkernel.py
        • kernelapp.py
        • kernelbase.py
        • pylab
          • config.py
        • session.py
        • zmqshell.py
    • utils
      • tests
        • test_traitlets.py
      • traitlets.py
  • ipython_parallel
    • apps
      • baseapp.py
      • ipengineapp.py
      • launcher.py
      • logwatcher.py
    • client
      • view.py
    • controller
      • heartmonitor.py
      • hub.py
      • mongodb.py
      • scheduler.py
      • sqlitedb.py
    • engine
      • engine.py
  • jupyter_console
    • interactiveshell.py
  • jupyter_nbconvert
    • nbconvertapp.py
  • jupyter_nbformat
    • sign.py
  • jupyter_qtconsole/console
    • frontend_widget.py

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎IPython/config/application.py‎

Copy file name to clipboardExpand all lines: IPython/config/application.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def _log_format_changed(self, name, old, new):
174174
_log_handler.setFormatter(_log_formatter)
175175

176176

177-
log = Instance(logging.Logger)
177+
log = Instance(logging.Logger, allow_none=True)
178178
def _log_default(self):
179179
"""Start logging for this application.
180180
Collapse file

‎IPython/config/configurable.py‎

Copy file name to clipboardExpand all lines: IPython/config/configurable.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MultipleInstanceError(ConfigurableError):
3434
class Configurable(HasTraits):
3535

3636
config = Instance(Config, (), {})
37-
parent = Instance('IPython.config.configurable.Configurable')
37+
parent = Instance('IPython.config.configurable.Configurable', allow_none=True)
3838

3939
def __init__(self, **kwargs):
4040
"""Create a configurable given a config config.
@@ -372,7 +372,7 @@ class LoggingConfigurable(Configurable):
372372
is to get the logger from the currently running Application.
373373
"""
374374

375-
log = Instance('logging.Logger')
375+
log = Instance('logging.Logger', allow_none=True)
376376
def _log_default(self):
377377
from IPython.utils import log
378378
return log.get_logger()
Collapse file

‎IPython/core/alias.py‎

Copy file name to clipboardExpand all lines: IPython/core/alias.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class AliasManager(Configurable):
193193

194194
default_aliases = List(default_aliases(), config=True)
195195
user_aliases = List(default_value=[], config=True)
196-
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
196+
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC', allow_none=True)
197197

198198
def __init__(self, shell=None, **kwargs):
199199
super(AliasManager, self).__init__(shell=shell, **kwargs)
Collapse file

‎IPython/core/application.py‎

Copy file name to clipboardExpand all lines: IPython/core/application.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def _ipython_dir_default(self):
146146
return d
147147

148148
_in_init_profile_dir = False
149-
profile_dir = Instance(ProfileDir)
149+
profile_dir = Instance(ProfileDir, allow_none=True)
150150
def _profile_dir_default(self):
151151
# avoid recursion
152152
if self._in_init_profile_dir:
Collapse file

‎IPython/core/builtin_trap.py‎

Copy file name to clipboardExpand all lines: IPython/core/builtin_trap.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ class __HideBuiltin(object): pass
3636

3737
class BuiltinTrap(Configurable):
3838

39-
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
39+
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC',
40+
allow_none=True)
4041

4142
def __init__(self, shell=None):
4243
super(BuiltinTrap, self).__init__(shell=shell, config=None)
Collapse file

‎IPython/core/displayhook.py‎

Copy file name to clipboardExpand all lines: IPython/core/displayhook.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class DisplayHook(Configurable):
2929
that gets called anytime user code returns a value.
3030
"""
3131

32-
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
32+
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC',
33+
allow_none=True)
3334
exec_result = Instance('IPython.core.interactiveshell.ExecutionResult',
3435
allow_none=True)
3536
cull_fraction = Float(0.2)
Collapse file

‎IPython/core/extensions.py‎

Copy file name to clipboardExpand all lines: IPython/core/extensions.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def load_ipython_extension(ipython):
4646
is added to ``sys.path`` automatically.
4747
"""
4848

49-
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
49+
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC',
50+
allow_none=True)
5051

5152
def __init__(self, shell=None, **kwargs):
5253
super(ExtensionManager, self).__init__(shell=shell, **kwargs)
Collapse file

‎IPython/core/history.py‎

Copy file name to clipboardExpand all lines: IPython/core/history.py
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ class HistoryManager(HistoryAccessor):
443443
# Public interface
444444

445445
# An instance of the IPython shell we are attached to
446-
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
446+
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC',
447+
allow_none=True)
447448
# Lists to hold processed and raw history. These start with a blank entry
448449
# so that we can index them starting from 1
449450
input_hist_parsed = List([""])
@@ -477,11 +478,12 @@ def _dir_hist_default(self):
477478
db_output_cache = List()
478479

479480
# History saving in separate thread
480-
save_thread = Instance('IPython.core.history.HistorySavingThread')
481+
save_thread = Instance('IPython.core.history.HistorySavingThread',
482+
allow_none=True)
481483
try: # Event is a function returning an instance of _Event...
482-
save_flag = Instance(threading._Event)
484+
save_flag = Instance(threading._Event, allow_none=True)
483485
except AttributeError: # ...until Python 3.3, when it's a class.
484-
save_flag = Instance(threading.Event)
486+
save_flag = Instance(threading.Event, allow_none=True)
485487

486488
# Private interface
487489
# Variables used to store the three last inputs from the user. On each new
Collapse file

‎IPython/core/interactiveshell.py‎

Copy file name to clipboardExpand all lines: IPython/core/interactiveshell.py
+15-15Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,13 @@ class InteractiveShell(SingletonConfigurable):
295295
disable_failing_post_execute = CBool(False, config=True,
296296
help="Don't call post-execute functions that have failed in the past."
297297
)
298-
display_formatter = Instance(DisplayFormatter)
299-
displayhook_class = Type(DisplayHook)
300-
display_pub_class = Type(DisplayPublisher)
298+
display_formatter = Instance(DisplayFormatter, allow_none=True)
299+
displayhook_class = Type(DisplayHook, allow_none=True)
300+
display_pub_class = Type(DisplayPublisher, allow_none=True)
301301
data_pub_class = None
302302

303303
exit_now = CBool(False)
304-
exiter = Instance(ExitAutocall)
304+
exiter = Instance(ExitAutocall, allow_none=True)
305305
def _exiter_default(self):
306306
return ExitAutocall(self)
307307
# Monotonically increasing execution counter
@@ -435,16 +435,16 @@ def _readline_parse_and_bind_changed(self, name, old, new):
435435
default_value='Context', config=True)
436436

437437
# Subcomponents of InteractiveShell
438-
alias_manager = Instance('IPython.core.alias.AliasManager')
439-
prefilter_manager = Instance('IPython.core.prefilter.PrefilterManager')
440-
builtin_trap = Instance('IPython.core.builtin_trap.BuiltinTrap')
441-
display_trap = Instance('IPython.core.display_trap.DisplayTrap')
442-
extension_manager = Instance('IPython.core.extensions.ExtensionManager')
443-
payload_manager = Instance('IPython.core.payload.PayloadManager')
444-
history_manager = Instance('IPython.core.history.HistoryAccessorBase')
445-
magics_manager = Instance('IPython.core.magic.MagicsManager')
446-
447-
profile_dir = Instance('IPython.core.application.ProfileDir')
438+
alias_manager = Instance('IPython.core.alias.AliasManager', allow_none=True)
439+
prefilter_manager = Instance('IPython.core.prefilter.PrefilterManager', allow_none=True)
440+
builtin_trap = Instance('IPython.core.builtin_trap.BuiltinTrap', allow_none=True)
441+
display_trap = Instance('IPython.core.display_trap.DisplayTrap', allow_none=True)
442+
extension_manager = Instance('IPython.core.extensions.ExtensionManager', allow_none=True)
443+
payload_manager = Instance('IPython.core.payload.PayloadManager', allow_none=True)
444+
history_manager = Instance('IPython.core.history.HistoryAccessorBase', allow_none=True)
445+
magics_manager = Instance('IPython.core.magic.MagicsManager', allow_none=True)
446+
447+
profile_dir = Instance('IPython.core.application.ProfileDir', allow_none=True)
448448
@property
449449
def profile(self):
450450
if self.profile_dir is not None:
@@ -453,7 +453,7 @@ def profile(self):
453453

454454

455455
# Private interface
456-
_post_execute = Instance(dict)
456+
_post_execute = Instance(dict, allow_none=True)
457457

458458
# Tracks any GUI loop loaded for pylab
459459
pylab_gui_select = None
Collapse file

‎IPython/core/magic.py‎

Copy file name to clipboardExpand all lines: IPython/core/magic.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class MagicsManager(Configurable):
301301
# A registry of the original objects that we've been given holding magics.
302302
registry = Dict
303303

304-
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
304+
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC', allow_none=True)
305305

306306
auto_magic = Bool(True, config=True, help=
307307
"Automatically call line magics without requiring explicit % prefix")
@@ -313,7 +313,7 @@ def _auto_magic_changed(self, name, value):
313313
'Automagic is OFF, % prefix IS needed for line magics.',
314314
'Automagic is ON, % prefix IS NOT needed for line magics.']
315315

316-
user_magics = Instance('IPython.core.magics.UserMagics')
316+
user_magics = Instance('IPython.core.magics.UserMagics', allow_none=True)
317317

318318
def __init__(self, shell=None, config=None, user_magics=None, **traits):
319319

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.