Skip to main content

A plugin for mypy that allows extra kwargs in function calls

Project description

allow-extra-kwargs

GitHub Actions Workflow Status PyPI - Python Version

A plugin for mypy that allows extra kwargs in function calls.

Description

allow-extra-kwargs is a Python package that provides a decorator and a mypy plugin to allow functions to accept extra keyword arguments in a type-safe way.

Installation

You can install allow-extra-kwargs using pip:

pip install allow-extra-kwargs

Usage

Decorator Usage

To use the allow_extra_kwargs decorator in your code:

from allow_extra_kwargs import allow_extra_kwargs


@allow_extra_kwargs
def my_function(a: int) -> int:
    return a


# Now you can call the function with extra kwargs
result = my_function(1, extra_arg="value")

Mypy Plugin

To enable the mypy plugin, add the following to your pyproject.toml:

[tool.mypy]
plugins = ["allow_extra_kwargs.mypy"]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

allow_extra_kwargs-0.1.1.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

allow_extra_kwargs-0.1.1-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file allow_extra_kwargs-0.1.1.tar.gz.

File metadata

  • Download URL: allow_extra_kwargs-0.1.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1025-azure

File hashes

Hashes for allow_extra_kwargs-0.1.1.tar.gz
Algorithm Hash digest
SHA256 66a6a1d164b8f8d5e9bc644fff7e852b068087d1266543a739ea17598344ff15
MD5 67d6d440edc83c5efdabc570b682be28
BLAKE2b-256 5bc07032d8de1c37a32f7627ac7a1c7de31a3d6753c50390b2588ae9714a48d6

See more details on using hashes here.

File details

Details for the file allow_extra_kwargs-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: allow_extra_kwargs-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1025-azure

File hashes

Hashes for allow_extra_kwargs-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d06dae31018faff5f886a7a843e8a562a1a720ea32922dbc19b870f8bbf5f3f0
MD5 3bd62e69d6e1f9fe9c55d64adae5810e
BLAKE2b-256 7560e12e2b379c19532dd85ae3dc08cf7079cee4e264087244230c81cbf23d53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page