https://github.com/xpodev/pyreflect
https://github.com/xpodev/pyreflect
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/xpodev/pyreflect
- Owner: xpodev
- Created: 2024-02-25T10:24:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-25T15:43:06.000Z (over 2 years ago)
- Last Synced: 2024-12-25T17:43:01.489Z (over 1 year ago)
- Language: Python
- Size: 17.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PyReflect
This library is a simple reflection library for Python. It is designed to be simple and easy to use.
## Installation
```bash
pip install pyreflect
```
## Usage
```python
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'