Skip to content

xpodev/pyreflect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'