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

Class AnyAttr

Lib/test/test_string/test_string.py:96–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 def test_name_lookup(self):
95 fmt = string.Formatter()
96 class AnyAttr:
97 def __getattr__(self, attr):
98 return attr
99 x = AnyAttr()
100 self.assertEqual(fmt.format("{0.lumber}{0.jack}", x), 'lumberjack')
101 with self.assertRaises(AttributeError):

Callers 1

test_name_lookupMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_name_lookupMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…