MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / a_getter

Function a_getter

gridfs/grid_file_shared.py:84–92  ·  view source on GitHub ↗
(self: Any)

Source from the content-addressed store, hash-verified

82 """Create a GridOut property."""
83
84 def a_getter(self: Any) -> Any:
85 if not self._file:
86 raise InvalidOperation(
87 "You must call GridOut.open() before accessing " "the %s property" % field_name
88 )
89 # Protect against PHP-237
90 if field_name == "length":
91 return self._file.get(field_name, 0)
92 return self._file.get(field_name, None)
93
94 docstring += "\n\nThis attribute is read-only."
95 return property(a_getter, doc=docstring)

Callers

nothing calls this directly

Calls 2

InvalidOperationClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected