Skip to content

septumca/pypd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Predicative dispatch decorator for python, based on idea from Functional Programming in Python

Module is providing means to specify condition that determine which function is called. Number of arguments in condition function in @predicate decorator must be equal to number of arguments of wrapped function

usage:

from predicate_dispatch import predicate

@predicate(lambda x: x>1)
def factorial(x):
  return x*factorial(x-1)

@predicate()
def factorial(x):
  return x
        
factorial(5) == 120

About

predicative dispatch decorator for python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages