Install
python
pip install decofhak
How to use
transform
python
from decofhak import transform
transform(int)
def x():
return "2"
type(x()) == int
transform()
def x() -> int:
return 2
type(x()) == int
transform()
def x() -> str:
return 2
type(x()) == str
transform(str)
def x():
return 2
type(x()) == str
transform(int)
def x():
return dict(a=1, b="2", c="0")
x() == dict(a=1, b=2, c=0)
transform()
def x() -> list:
return dict(a=1, b="2", c="0")
x() == dict(a=[1], b=['2'], c=['0'])
transform(str)
def x() -> int:
return 2
type(x()) == int
dictobj
python
from decofhak import dictobj
dictobj
def x():
return dict(a=1, b="2", c="0")
>>> x().a
1
>>> x().b
"2"
>>> x().c
"0"
dictobj
def x():
return 2
>>> x()
2
All
python
dictobj
transform(list)
transform(int)
def x():
return dict(a=(1, 2, 3), b="2", c="0")
{'a': [1, 2, 3], 'b': [2], 'c': [0]}
dictobj
transform(list)
transform(int)
def x():
return dict(a=(1, 2, 3), b="2", c="0")
x().a -> [1, 2, 3]