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

Class C

Lib/test/test_class.py:699–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

697 y = 0
698 __slots__ = ('z',)
699 class C:
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 8

__init__Method · 0.70
add_one_levelMethod · 0.70
test_many_attributesMethod · 0.70
test_bug_117750Method · 0.70

Calls

no outgoing calls

Tested by 8

__init__Method · 0.56
add_one_levelMethod · 0.56
test_many_attributesMethod · 0.56
test_bug_117750Method · 0.56