Skip to content

Instantly share code, notes, and snippets.

@clbarnes
Created July 29, 2019 15:43
Show Gist options
  • Select an option

  • Save clbarnes/edd28ea32010eb159b34b075687bb49e to your computer and use it in GitHub Desktop.

Select an option

Save clbarnes/edd28ea32010eb159b34b075687bb49e to your computer and use it in GitHub Desktop.
Get the fully-qualified class name of a python object
def classname(obj):
cls = type(obj)
module = cls.__module__
name = cls.__qualname__
if module is not None and module != "__builtin__":
name = module + "." + name
return name
@mankec

mankec commented May 5, 2025

Copy link
Copy Markdown

Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment