Skip to main content

A plugin for mypy that allows extra kwargs in function calls

Project description

allow-extra-kwargs

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.0.tar.gz (2.0 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.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: allow_extra_kwargs-0.1.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.9.17 Darwin/23.5.0

File hashes

Hashes for allow_extra_kwargs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed215f8fb8ffc66aa5926903ac65358ac7f539a88a376bab2435bcb7fb3ba72d
MD5 cf18a822cd50d452eed218a9d102eae4
BLAKE2b-256 a1d049ef386479f1925830850c9b57e331a6174d04dd9cf14776b487e59d4025

See more details on using hashes here.

File details

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

File metadata

  • Download URL: allow_extra_kwargs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.9.17 Darwin/23.5.0

File hashes

Hashes for allow_extra_kwargs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7acddcf82c3cdc3dc7f03ff6fdfd55bc81dfb21c0bf0b41fb880c1455115797
MD5 615561867cc2540865978df1a8a8d036
BLAKE2b-256 ed937ef025d30b13e2754c99144264e70d061541c0ea994cf0dd8d2053209246

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