Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 781 Bytes

README.md

File metadata and controls

34 lines (22 loc) · 781 Bytes

simpleufcs

A simple (and ugly) Uniform Function Call Syntax (UFCS) implementation in python.

Usage

Installation:

pip install simpleufcs

Usage:

from simpleufcs import UFCS
UFCS([3, 2, 1]).sorted(key=lambda x: x <= 1).map(lambda x: x * 2).list().print()

benchmark

In the benchmark, the UFCS implementation is 3-8 times slower than the built-in method.

Windows, python 3.12

bench ufcs builtin
1 0.02407699999457691 0.006241800001589581

Linux, python 3.11.6

bench ufcs builtin
1 0.0327424000006431 0.004318577999583795