https://github.com/emmatyping/typycal
Generate stubs from Python code at runtime (An experiment!)
https://github.com/emmatyping/typycal
Last synced: 4 months ago
JSON representation
Generate stubs from Python code at runtime (An experiment!)
- Host: GitHub
- URL: https://github.com/emmatyping/typycal
- Owner: emmatyping
- Created: 2017-07-05T22:14:00.000Z (almost 8 years ago)
- Default Branch: develop
- Last Pushed: 2017-11-14T03:05:51.000Z (over 7 years ago)
- Last Synced: 2025-02-07T09:33:49.427Z (4 months ago)
- Language: C++
- Homepage:
- Size: 126 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Typycal
Typycal is an experimental project to generate PEP 484 and 526 compliant stub files based on runtime types. The hope is to ease the
creation of stub files for projects and allow more projects to take advantage of typing in Python.# Basic example
>>> from _typycal import *
>>> hook()
True
>>> def foo(a,b,c):
... return "The answer to a + b + c is", a + b + c
...
>>> foo(1,2,3)
{"frame" : "foo", "file" : "", "args" : {"a" : "int", "b" : "int", "c" : "int"}, "ret" : "Tuple[str, int]"}
('The answer to a + b + c is', 6)
# Building
python setup.py build_ext
cd build/lib...
python
...# Status
This project is an experiment in how fast and with what accuracy an interpreter hook can collect type information. I have the
interpeter hook running well, but there is no permanent logging, stub generation, or anything beyond an example.