Do a full, attribute-walking lookup of the ifun in the various namespaces for the given IPython InteractiveShell instance. Return a dict with keys: {found, obj, ospace, ismagic} Note: can cause state changes because of calling getattr, but should only be run if auto
(self, ip)
| 125 | self.pre_whitespace = self.pre |
| 126 | |
| 127 | def ofind(self, ip) -> OInfo: |
| 128 | """Do a full, attribute-walking lookup of the ifun in the various |
| 129 | namespaces for the given IPython InteractiveShell instance. |
| 130 | |
| 131 | Return a dict with keys: {found, obj, ospace, ismagic} |
| 132 | |
| 133 | Note: can cause state changes because of calling getattr, but should |
| 134 | only be run if autocall is on and if the line hasn't matched any |
| 135 | other, less dangerous handlers. |
| 136 | |
| 137 | Does cache the results of the call, so can be called multiple times |
| 138 | without worrying about *further* damaging state. |
| 139 | |
| 140 | .. deprecated:: 9.8 |
| 141 | Use ``shell._ofind(line_info.ifun)`` directly instead. |
| 142 | """ |
| 143 | warnings.warn( |
| 144 | "LineInfo.ofind() is deprecated since IPython 9.9. " |
| 145 | "Use shell._ofind(line_info.ifun) directly instead.", |
| 146 | DeprecationWarning, |
| 147 | stacklevel=2, |
| 148 | ) |
| 149 | return ip._ofind(self.ifun) |
| 150 | |
| 151 | def __str__(self) -> str: |
| 152 | return "LineInfo [%s|%s|%s|%s]" % (self.pre, self.esc, self.ifun, self.the_rest) |