MCPcopy
hub / github.com/danielgtaylor/python-betterproto / __bool__

Method __bool__

src/betterproto/__init__.py:877–883  ·  view source on GitHub ↗

True if the Message has any fields with non-default values.

(self)

Source from the content-addressed store, hash-verified

875 super().__setattr__(attr, value)
876
877 def __bool__(self) -> bool:
878 """True if the Message has any fields with non-default values."""
879 return any(
880 self.__raw_get(field_name)
881 not in (PLACEHOLDER, self._get_field_default(field_name))
882 for field_name in self._betterproto.meta_by_field_name
883 )
884
885 def __deepcopy__(self: T, _: Any = {}) -> T:
886 kwargs = {}

Callers

nothing calls this directly

Calls 2

__raw_getMethod · 0.95
_get_field_defaultMethod · 0.95

Tested by

no test coverage detected