Skip to main content

A simple recursive function that allows to give more information about an object than 'type' binded function

Project description

Overview

Supertype-python is a package containing a single function, supertype(). This one works like type but gives more information, which could be useful in a development phase.

Installation

pip install supertype-python

Usage

Without this package, it would take some precious time and precious attention to know the content of an object like this :

a = [0,1,2]
b = 'bbb'
c = 5
d = {"x": "X", "y": "Y", "z": "Z"}
e = [a,b]
f = array('l', [1, 2, 3, 4, 5])
g = (f,e,c,d)

Now, you can import supertype() and just ask the supertype of the object f :

from supertype import supertype

supertype(g)

This returns :

tuple of 4 elements containing : 
    -array of 5 elements containing {'int'}
    -list of 2 elements containing : 
        -list of 3 elements containing {'int'}
        -str of 3 elements
    -int
    -dict of 3 elements

This also works with objects from other librairies and even with you homemade objects !

What should be added soon

-correction of language approximations
-specific treatment for some types (not very useful to know the size of a string for example)
-better comments
-check compatibility with all python 3, see if it can go to python 2
-...

If you have any idea or suggestion feel free to contact me on my email.

Contributors

Martin Letzgus
Antoine Thiol
Quentin Petit

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

supertype-python-1.1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

supertype_python-1.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file supertype-python-1.1.0.tar.gz.

File metadata

  • Download URL: supertype-python-1.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for supertype-python-1.1.0.tar.gz
Algorithm Hash digest
SHA256 816322f9cb7bb6c53385273f7d9ade89944ed96672cc21f3b131139ff0a0f063
MD5 193dd18cc3c2b8ee7253b8d632a4b1c4
BLAKE2b-256 ee5b8bec99c4b78311c1ace20a4d68a140173dbd29296c4b35d8589ec851a54d

See more details on using hashes here.

File details

Details for the file supertype_python-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: supertype_python-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for supertype_python-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92b7cfe0605f6c720eee12ce544cadbfd3362722a76930df0c385d9df6589be3
MD5 db278a3e8e0b64799249535025a99c13
BLAKE2b-256 86a19a9157dfc2dfdf5ba0b242969ec1868b5fed07a9885d370fd3627fbe8ad0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page