Skip to main content

OOP approach for python reflection

Project description

PyReflect

This library is a simple reflection library for Python. It is designed to be simple and easy to use.

Installation

pip install pyreflect

Usage

from pyreflect import reflect


def foo():
    return 1


foo_meta = reflect(foo)
print(foo_meta.name)  # foo
foo_meta.args.add("a", reflect(int))

foo_meta.update_origin()

try:
    foo()
except TypeError as e:
    print(e)  # foo() missing 1 required positional argument: 'a'

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

pyreflect-0.1.0.tar.gz (10.0 kB view hashes)

Uploaded Source

Built Distribution

pyreflect-0.1.0-py3-none-any.whl (17.7 kB view hashes)

Uploaded Python 3

Supported by

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