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

Method __init__

example_code/item_056.py:80–81  ·  view source on GitHub ↗
(self, name, x, y)

Source from the content-addressed store, hash-verified

78print("Example 5")
79class ImmutablePoint:
80 def __init__(self, name, x, y):
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")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected