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

Method __get__

example_code/item_064.py:58–61  ·  view source on GitHub ↗
(self, instance, instance_type)

Source from the content-addressed store, hash-verified

56
57 print("Example 2")
58 def __get__(self, instance, instance_type):
59 if instance is None:
60 return self
61 return getattr(instance, self.internal_name, "")
62
63 def __set__(self, instance, value):
64 setattr(instance, self.internal_name, value)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected