Skip to content

A Python typename which returns the name of the type of any object as a string

License

Notifications You must be signed in to change notification settings

sixty-north/typename

Repository files navigation

Typename

CI

The typename module defines a single function also called typename which returns the name of the type of any object as a string.

Its purpose is purely aesthetic, to avoid unsightly constructs such as type(obj).__name__ or the ghastly obj.__class__.__name__.

Installation

The typename package is available on the Python Package Index (PyPI):

PyPI version

Typename should work with any version of Python 3. To install:

With pip from PyPI:

pip install typename

How to use

>>> from typename import typename
>>> x = 5
>>> typename(x)
'int'

About

A Python typename which returns the name of the type of any object as a string

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages