INNER CODE UNIT · Python
__call__
google-antigravity/antigravity-sdk-python · google/antigravity/beta/__init__.py:138
def __call__(self, obj_or_name: Any = None, /) -> Any:
"""Allows `beta` in class scope to act as the `@beta` decorator."""
return beta(obj_or_name)
def __get__(self, instance: Any, owner: type[Any] | None = None) -> Any:
if owner is None:
owner = type(instance)
if instance is None:
cached = owner.__dict__.get(_CLASS_NS_CACHE_ATTR)
if cached is None:
cached = _BoundBetaNamespace(None, owner)
setattr(owner, _CLASS_NS_CACHE_ATTR, cached)
return cached
if hasattr(instance, "__dict__"):
cached = instance.__dict__.get(_INSTANCE_NS_CACHE_ATTR)
if cached is not None and cached._instance is instance:
return cached