Skip to content

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

License

Notifications You must be signed in to change notification settings

lxl66566/simpleufcs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages