View the structure of Python classes and functions
Project description
objinspect
View the structure of Python classes and functions.
Installation
From PyPi
pip install objinspect
From source
pip install git+https://github.com/zigai/objinspect
Example
>>> import math
>>> from objinspect import inspect
>>> inspect(math.pow)
Function(name='pow', parameters=2, description='Return x**y (x to the power of y).')
>>> inspect(math.pow).dict
[
{
"default":"<class""inspect._empty"">",
"description":"None",
"kind":"<_ParameterKind.POSITIONAL_ONLY":0>,
"name":"x",
"type":"<class""inspect._empty"">"
},
{
"default":"<class""inspect._empty"">",
"description":"None",
"kind":"<_ParameterKind.POSITIONAL_ONLY":0>,
"name":"y",
"type":"<class""inspect._empty"">"
}
]
>>> inspect(inspect)
Function(
name="inspect",
parameters=2,
description="The inspect function takes an object and an optional include_inherited flag (defaults to True) and returns either a Function object or a Class object depending on the type of object.",
)
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
objinspect-0.2.9.tar.gz
(14.7 kB
view hashes)
Built Distribution
objinspect-0.2.9-py3-none-any.whl
(14.1 kB
view hashes)
Close
Hashes for objinspect-0.2.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b10e1938ec75561c8afe83100b7ef0af3ad0568f21d9cea121682f87440c10ac |
|
MD5 | 41407e5aa80e5cf7a840dc6122c885fa |
|
BLAKE2b-256 | 87349ed94b530cb08513be44fd50f34aaaf1a64eefd7d1af9c623a9a2a2f3940 |