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.post1.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.post1-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: allow_extra_kwargs-0.1.1.post1.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.post1.tar.gz
Algorithm Hash digest
SHA256 34dc805c695a04b5f5c17fca0b70905314cc695a64badfbbadd7baad7fe955c8
MD5 bd69d8bbc7b858a6720979ba7df21282
BLAKE2b-256 f123b01343efb8fca5fe6b0a72d700ab88117bcad97dc3c05d7406e71ae1ecf6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for allow_extra_kwargs-0.1.1.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 4871b1879821eda33534afde4aa155466ec6254801e62e9ed27a622fae708623
MD5 275b84778fd3c69271e449da8d4902e1
BLAKE2b-256 6b0e0784036d6c38f56ad71a447fdcdf0cf34f174df1d6a7efb991ab819560cc

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