INNER CODE UNIT · Python

_mark_beta

google-antigravity/antigravity-sdk-python · google/antigravity/beta/__init__.py:63

def _mark_beta(obj: Any) -> Any:
  """Marks `obj` (and any underlying descriptor function) with `_BETA_ATTR`."""
  for target in (
      obj,
      obj.fget if isinstance(obj, property) else None,
      obj.__func__ if isinstance(obj, (classmethod, staticmethod)) else None,
  ):
    if target is not None:
      try:
        setattr(target, _BETA_ATTR, True)
      except (AttributeError, TypeError):
        pass
  return obj


def _collect_beta_members(owner: type[Any]) -> dict[str, Any]:
  """Collects all `@beta` members across `owner`'s MRO."""
  merged: dict[str, Any] = {}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…