MCPcopy
hub / github.com/pydantic/pydantic / FooGetAttr

Class FooGetAttr

tests/test_deprecated.py:175–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173
174def test_object_with_getattr():
175 class FooGetAttr:
176 def __getattr__(self, key: str):
177 if key == 'foo':
178 return 'Foo'
179 else:
180 raise AttributeError
181
182 class Model(BaseModel):
183 model_config = ConfigDict(from_attributes=True)

Callers 1

test_object_with_getattrFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_object_with_getattrFunction · 0.68