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

Method allow_new_attr

IPython/utils/ipstruct.py:265–271  ·  view source on GitHub ↗

Set whether new attributes can be created in this Struct. This can be used to catch typos by verifying that the attribute user tries to change already exists in this Struct.

(self, allow = True)

Source from the content-addressed store, hash-verified

263 return key in self
264
265 def allow_new_attr(self, allow = True):
266 """Set whether new attributes can be created in this Struct.
267
268 This can be used to catch typos by verifying that the attribute user
269 tries to change already exists in this Struct.
270 """
271 object.__setattr__(self, '_allownew', allow)
272
273 def merge(self, __loc_data__=None, __conflict_solve=None, **kw):
274 """Merge two Structs with customizable conflict resolution.

Callers

nothing calls this directly

Calls 1

__setattr__Method · 0.45

Tested by

no test coverage detected