FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

pytype/pytype/tools/merge_pyi at main · google/pytype · GitHub

This repository was archived by the owner on Sep 3, 2026. It is now read-only.
/ pytype Public archive

Latest commit

 

History

History

README.md

Copy type annotations from a PEP484 stub file into python source.

Sample uses

Print to stdout what simple.py would look like with the type annotations from simple.pyi added:

       merge-pyi test_data/simple.py test_data/simple.pyi

Output a diff of the changes to simple.py:

       merge-pyi --diff test_data/simple.py test_data/simple.pyi

Overwrite simple.py:

       merge-pyi -i test_data/simple.py test_data/simple.pyi

Regression tests

test_data/foo.py  : input we want to annotate
test_data/foo.pyi : type hints we want to add to foo.py (may be intentionally bad)

test_data/foo.pep484.py  : expected output, inserting types in PEP484 style

Note

This script is a wrapper around LibCST's type annotation merging library. You are welcome to file bugs and feature requests here, but changes are mostly made to the upstream code.


Back | FazBrowse Home | New Git URL