MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / __setattr__

Method __setattr__

example_code/item_056.py:83–84  ·  view source on GitHub ↗
(self, key, value)

Source from the content-addressed store, hash-verified

81 self.__dict__.update(name=name, x=x, y=y)
82
83 def __setattr__(self, key, value):
84 raise AttributeError("Immutable object: set not allowed")
85
86 def __delattr__(self, key):
87 raise AttributeError("Immutable object: del not allowed")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected