MCPcopy Index your code
hub / github.com/python/cpython / __setattr__

Method __setattr__

Lib/test/test_class.py:702–706  ·  view source on GitHub ↗
(self, name, value)

Source from the content-addressed store, hash-verified

700 __slots__ = ("y",)
701
702 def __setattr__(self, name, value) -> None:
703 if name == "z":
704 super().__setattr__("y", 1)
705 else:
706 super().__setattr__(name, value)
707
708 error_msg = "'A' object has no attribute 'x'"
709 with self.assertRaisesRegex(AttributeError, error_msg):

Callers 4

test_errorMethod · 0.45
testMethod · 0.45

Calls 1

superClass · 0.85

Tested by

no test coverage detected