from typing import Type


def isnestedclass(cls: Type, scope: Type) -> bool:
	"""Returns true, if the given class ``cls`` is a member on an outer class ``scope``."""
	for mroClass in scope.mro():
		for memberName in mroClass.__dict__:
			member = getattr(mroClass, memberName)
			if isinstance(member, Type):
				if cls is member:
					return True

	return False