from typing import Any
from typing import Set


def all_names_on_object(obj: Any) -> Set[str]:
  """Get all names of attributes on self and its classes throughout MRO."""
  nameset = set(obj.__dict__.keys())
  for cls in obj.__class__.__mro__:
    nameset = nameset.union(set(cls.__dict__.keys()))
  return nameset