MCPcopy Index your code
hub / github.com/ipython/ipython / check_for_underscore

Method check_for_underscore

IPython/core/displayhook.py:73–85  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

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

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected