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

Class OInfo

IPython/core/oinspect.py:67–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65
66@dataclass
67class OInfo:
68 ismagic: bool
69 isalias: bool
70 found: bool
71 namespace: Optional[str]
72 parent: Any
73 obj: Any
74
75 def get(self, field):
76 """Get a field from the object for backward compatibility with before 8.12
77
78 see https://github.com/h5py/h5py/issues/2253
79 """
80 # We need to deprecate this at some point, but the warning will show in completion.
81 # Let's comment this for now and uncomment end of 2023 ish
82 # Jan 2025: decomenting for IPython 9.0
83 warnings.warn(
84 f"OInfo dataclass with fields access since IPython 8.12 please use OInfo.{field} instead."
85 "OInfo used to be a dict but a dataclass provide static fields verification with mypy."
86 "This warning and backward compatibility `get()` method were added in 8.13.",
87 DeprecationWarning,
88 stacklevel=2,
89 )
90 return getattr(self, field)
91
92
93def pylight(code):

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…