A dict subclass that always returns the factory instance and claims to have any item.
| 1332 | |
| 1333 | |
| 1334 | class _GetItemDuck(dict): |
| 1335 | """A dict subclass that always returns the factory instance and claims to have any item.""" |
| 1336 | |
| 1337 | def __init__(self, factory, *args, **kwargs): |
| 1338 | super().__init__(*args, **kwargs) |
| 1339 | self._factory = factory |
| 1340 | |
| 1341 | def __getitem__(self, key): |
| 1342 | return self._factory() |
| 1343 | |
| 1344 | def __contains__(self, key): |
| 1345 | return True |
| 1346 | |
| 1347 | |
| 1348 | def _resolve_annotation( |
no outgoing calls
no test coverage detected
searching dependent graphs…