Skip to main content

No project description provided

Project description

funcclasses

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install funcclasses

Usage

partial

from typing import Callable, SupportsInt, SupportsComplex, SupportsFloat
from beartype import beartype
from funcclasses.partial import partial

Numberlike = SupportsFloat | SupportsComplex | SupportsInt

def my_list_mut(
        func: Callable[[Numberlike, Numberlike], Numberlike],
        a: Numberlike,
        b: Numberlike,
    ):
    return func(a,b)

@beartype
def add(a:Numberlike, b:Numberlike) -> Numberlike:
    return a + b

sum_generic = partial(my_list_mut, add)

if __name__ == "__main__":
    sum_generic(a=21,b=21) # -> 42

License

funcclasses is distributed under the terms of the MIT license.

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

funcclasses-0.0.2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

funcclasses-0.0.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file funcclasses-0.0.2.tar.gz.

File metadata

  • Download URL: funcclasses-0.0.2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for funcclasses-0.0.2.tar.gz
Algorithm Hash digest
SHA256 fc74fde95be3cae57a0c043f553ec210865e4bb9df822a2eb99dcc1d92feff81
MD5 df5b57b90c38eb4b62fe40c369ab3b75
BLAKE2b-256 dbcebfd8dcc2d86e932e7e16c90ad2e6cb01008e7e87d971c85e03e127dfcd78

See more details on using hashes here.

File details

Details for the file funcclasses-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: funcclasses-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for funcclasses-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 916b25c3f2deb0e9790f092d8ef6835a6b3a8b4a905e717adfc3b8dd2e7a6f29
MD5 57b4d4d1f690cb272ce3395f84326bb6
BLAKE2b-256 aa72d2d806657aee8662ead6e8301dcdb301625070e3745652f8779ab4dbdd19

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