JelleZijlstra / stubdefaulter

Add default values to stubs
Other
10 stars 4 forks source link

stubdefaulter

A tool for automatically adding default values to Python type stubs.

Background

Stub files, as specified in PEP 484 provide a way for type checkers to see the interface to a module that is not itself typed. Historically, default values for arguments were usually omitted in stub files, because they are not needed for type checking. However, stub files are also useful for IDEs, which do want to show defaults. Therefore, the typeshed project has decided to allow defaults for stubs. This tool provides a way to auto-add defaults for stubs.

Usage

Warning: The tool will import and/or install various packages. Make sure you trust the package you are trying to add defaults for. Please run it inside a virtual environment.

Limitations/TODOs

Changelog

Version 0.1.0 (May 1, 2023)

Initial PyPI release.