No project description provided
Project description
funcclasses
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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc74fde95be3cae57a0c043f553ec210865e4bb9df822a2eb99dcc1d92feff81
|
|
| MD5 |
df5b57b90c38eb4b62fe40c369ab3b75
|
|
| BLAKE2b-256 |
dbcebfd8dcc2d86e932e7e16c90ad2e6cb01008e7e87d971c85e03e127dfcd78
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
916b25c3f2deb0e9790f092d8ef6835a6b3a8b4a905e717adfc3b8dd2e7a6f29
|
|
| MD5 |
57b4d4d1f690cb272ce3395f84326bb6
|
|
| BLAKE2b-256 |
aa72d2d806657aee8662ead6e8301dcdb301625070e3745652f8779ab4dbdd19
|