MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / __getattr__

Method __getattr__

gridfs/asynchronous/grid_file.py:1591–1600  ·  view source on GitHub ↗
(self, name: str)

Source from the content-addressed store, hash-verified

1589 )
1590
1591 def __getattr__(self, name: str) -> Any:
1592 if _IS_SYNC:
1593 self.open() # type: ignore[unused-coroutine]
1594 elif not self._file:
1595 raise InvalidOperation(
1596 "You must call AsyncGridOut.open() before accessing the %s property" % name
1597 )
1598 if name in self._file:
1599 return self._file[name]
1600 raise AttributeError("GridOut object has no attribute '%s'" % name)
1601
1602 def readable(self) -> bool:
1603 return True

Callers

nothing calls this directly

Calls 2

openMethod · 0.95
InvalidOperationClass · 0.90

Tested by

no test coverage detected