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 fntypes 0.1.4.post3

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

Source distribution (sdist)

Source distribution for fntypes 0.1.4.post3
File Size Uploaded
fntypes-0.1.4.post3.tar.gz 5.7 kB Details

Built distribution (wheel)

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

Total release size: 14.5 kB

Release files / fntypes-0.1.4.post3.tar.gz

Download URL fntypes-0.1.4.post3.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
da0b40925039ac98bff11b3f902cb1380c32671737ebc42014e26a327bd96811
BLAKE2b-256 checksum
How to use checksums
0cd020c11b86f20442e64d2dabb9342525a041561130e81ad71cfc309f1d155e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.0 CPython/3.11.9 Darwin/23.6.0

Release files / fntypes-0.1.4.post3-py3-none-any.whl

Download URL fntypes-0.1.4.post3-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea67b65d1f528de742f91cea433aaccb6f6dabfbe8ea2c579878388e7c1b3b3e
BLAKE2b-256 checksum
How to use checksums
ed372fb47ec4d531cfca52bf7b18379eee3c418d789b230b0cf182331a30b1c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.0 CPython/3.11.9 Darwin/23.6.0
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