INNER CODE UNIT · Python

is_beta

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

def is_beta(obj: Any) -> bool:
  """Returns True if `obj` is marked as a beta API symbol, method, or property."""
  if getattr(obj, _BETA_ATTR, False):
    return True
  if isinstance(obj, property):
    return bool(getattr(obj.fget, _BETA_ATTR, False))
  if isinstance(obj, (classmethod, staticmethod)):
    return bool(getattr(obj.__func__, _BETA_ATTR, False))
  return False


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,
  ):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…