MCPcopy Create free account
hub / github.com/python/cpython / __getattr__

Method __getattr__

Lib/test/test_descr.py:5966–5971  ·  view source on GitHub ↗
(self, attr)

Source from the content-addressed store, hash-verified

5964 class A:
5965 __slotnames__ = [S('spam')]
5966 def __getattr__(self, attr):
5967 if attr == 'spam':
5968 A.__slotnames__[:] = [S('spam')]
5969 return 42
5970 else:
5971 raise AttributeError
5972
5973 import copyreg
5974 expected = (copyreg.__newobj__, (A,), (None, {'spam': 42}), None, None)

Callers 1

fooMethod · 0.95

Calls 1

SClass · 0.70

Tested by

no test coverage detected