MCPcopy Create free account
hub / github.com/ipython/ipython / check_for_underscore

Method check_for_underscore

IPython/core/displayhook.py:70–82  ·  view source on GitHub ↗

Check if the user has set the '_' variable by hand.

(self)

Source from the content-addressed store, hash-verified

68 #-------------------------------------------------------------------------
69
70 def check_for_underscore(self):
71 """Check if the user has set the '_' variable by hand."""
72 # If something injected a '_' variable in __builtin__, delete
73 # ipython's automatic one so we don't clobber that. gettext() in
74 # particular uses _, so we need to stay away from it.
75 if '_' in builtin_mod.__dict__:
76 try:
77 user_value = self.shell.user_ns['_']
78 if user_value is not self._:
79 return
80 del self.shell.user_ns['_']
81 except KeyError:
82 pass
83
84 def quiet(self):
85 """Should we silence the display hook because of ';'?"""

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected