Skip to main content

fntypes

Functional typing in Python!

See examples

See documentation

fntypes is based on the belief that raising exceptions should be avoided. Therefore, it offers a set of functional types needed to write better code. This type strategy grants your project with higher control over type system - improves control flow

Contributions are welcome

@unwrapping
def send_funds(
    sender_id: int, 
    receiver_id: int, 
    amount: decimal.Decimal,
) -> Result[TransactionID, str]:
    sender = get_user(sender_id).expect("Sender is undefined")
    receiver = get_user(receiver_id).expect("Receiver is undefined")
    if sender.get_balance().unwrap() < amount:
        return Error("Sender has not enough funds to complete transaction")
    
    return Ok(
        create_transaction(sender, receiver, amount)
        .unwrap()
        .transaction_id
    )

Metadata

Release files for funtypes 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for funtypes 0.2.1
File Size Uploaded
funtypes-0.2.1.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for funtypes 0.2.1
File Interpreter ABI Platform
funtypes-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 kB

Release files / funtypes-0.2.1.tar.gz

Download URL funtypes-0.2.1.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f1b35a355c52193c4dfd6a06b39cbbb07125be3d5331ebc0aac9c3d2b3e5c193
BLAKE2b-256 checksum
How to use checksums
a259dc2bcf2bdacbd45b964bc8f588c87c8684f7d1828251eaaa46248b78bbc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.3 Windows/11

Release files / funtypes-0.2.1-py3-none-any.whl

Download URL funtypes-0.2.1-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
878129ec67117cad9719579897bd4cd7c35a332972bc226c860f7fc39336a658
BLAKE2b-256 checksum
How to use checksums
10d42c623f3aa7336f7347d07c92a419eb9450fd517c9b20e7624637e5f7dc3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.3 Windows/11

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page