Skip to content

decorator that convert specified parameters before pass them to a function or method

Notifications You must be signed in to change notification settings

bit-strange/pywarper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 

Repository files navigation

pywarper

convert function passed arguments before its warping up the body of function as function(convert(x))

example:

from pywarper import warp

def converter_1(value):
    return (value*value) + 1  

def converter_2(value):
    return (value/2)*3.14

register = {"z":converter_1,"y":converter_2}

@warp(register)
def function(x,y,z):
    return x+y+z

function(2,4,8)

register["x"] = lambda value : value

function(2,4,8)

detail: you can remove init file and take only the pywarper.py into your env

About

decorator that convert specified parameters before pass them to a function or method

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages