paramfunc 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- paramfunc-0.0.1/LICENSE.txt +21 -0
- paramfunc-0.0.1/PKG-INFO +79 -0
- paramfunc-0.0.1/README.md +64 -0
- paramfunc-0.0.1/pyproject.toml +22 -0
- paramfunc-0.0.1/setup.cfg +4 -0
- paramfunc-0.0.1/src/__init__.py +0 -0
- paramfunc-0.0.1/src/paramfunc.egg-info/PKG-INFO +79 -0
- paramfunc-0.0.1/src/paramfunc.egg-info/SOURCES.txt +9 -0
- paramfunc-0.0.1/src/paramfunc.egg-info/dependency_links.txt +1 -0
- paramfunc-0.0.1/src/paramfunc.egg-info/top_level.txt +2 -0
- paramfunc-0.0.1/src/paramfunc.py +99 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 light.seeker
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
paramfunc-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: paramfunc
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Decorator and class for easy argument conversion and validation.
|
|
5
|
+
Author-email: "light.seeker" <light.the.seeker@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://pypi.org/project/paramfunc/
|
|
8
|
+
Project-URL: Repository, https://github.com/Lightseeker7/paramfunc
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE.txt
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# paramfunc
|
|
17
|
+
Decorator and class for easy argument conversion and validation..
|
|
18
|
+
|
|
19
|
+
Github: [link](https://github.com/Lightseeker7/paramfunc)
|
|
20
|
+
|
|
21
|
+
Project: [link](https://pypi.org/project/paramfunc/)
|
|
22
|
+
|
|
23
|
+
# @parameterize
|
|
24
|
+
The function decorator takes up to two arguments, `params` and `kwparams`, and converts the function into a callable `ParamFunc` object. This `ParamFunc` object can be called as a normal function can, only it will first convert the arguments and check them against any related parameters.
|
|
25
|
+
|
|
26
|
+
Formatted as follows:
|
|
27
|
+
```
|
|
28
|
+
@parameterize(params=<params>,kwparams=<kwparams>)
|
|
29
|
+
def my_func(arg1,arg2):
|
|
30
|
+
return arg1 + arg2
|
|
31
|
+
```
|
|
32
|
+
In the event a converted argument does not satisfy a parameter, it will throw an error. Any errors involved with converting the argument will also occur, where applicable.
|
|
33
|
+
## params
|
|
34
|
+
Set to `None` if none are given.
|
|
35
|
+
|
|
36
|
+
`params` is used for all positional-only arguments, what would be called with `*args`
|
|
37
|
+
|
|
38
|
+
The format for `params` is a `dict` object formatted like the following:
|
|
39
|
+
```
|
|
40
|
+
{"convert":convert,"params":[boolean functions]}
|
|
41
|
+
```
|
|
42
|
+
An example of a `params` argument that converts all input items in `*args` to `int` objects and checks if they are even and not negative:
|
|
43
|
+
```
|
|
44
|
+
{"convert":int,"params":[lambda x:x>=0,lambda x:x%2==0]}
|
|
45
|
+
```
|
|
46
|
+
## kwparams
|
|
47
|
+
Set to `None` if none are given.
|
|
48
|
+
|
|
49
|
+
`kwparams` is used for all other arguments, whether they are keyword-only or positional with a keyword.
|
|
50
|
+
|
|
51
|
+
The format for `kwparams` is a `dict` object formatted like the following:
|
|
52
|
+
```
|
|
53
|
+
{"keyword1":{"convert":convert,"params":[boolean functions]},"keyword2":{"convert":convert,"params":[boolean functions]}}
|
|
54
|
+
```
|
|
55
|
+
An example of a `kwparams` argument that checks if the `"file"` argument is a .txt file and the `"contents"` is a list of strings:
|
|
56
|
+
```
|
|
57
|
+
{"file":{"convert":str,"params":[lambda x:x[-4:]==".txt",lambda x:len(x)>=5]},"contents":{"convert":list,"params":[lambda x:all(isinstance(item,str) for item in x)]}}
|
|
58
|
+
```
|
|
59
|
+
If a keyword argument has no need for conversion or for checking against a variable, it can be omitted from `kwparams`.
|
|
60
|
+
## "convert"
|
|
61
|
+
`"convert"` can be a `type` object such as `int` or `str`, or it can be any function that takes the related argument and returns a value. This can be a `lambda` or a function defined elsewhere in the program. If no change should happen to the related argument(s), but there still needs to be `"params"` for it, it should be set to the following:
|
|
62
|
+
```
|
|
63
|
+
"convert":lambda x:x
|
|
64
|
+
```
|
|
65
|
+
## "params"
|
|
66
|
+
`"params"` is a list of functions that all must return boolean values. These can be `lambda` functions or functions defined elsewhere in the program. If no parameters are needed for the argument, but it needs to be converted with `"convert"`, it should just be set to an empty list:
|
|
67
|
+
```
|
|
68
|
+
"params":[]
|
|
69
|
+
```
|
|
70
|
+
# ParamFunc
|
|
71
|
+
`@paramterize` converts the function it is decorating into a `ParamFunc` object. This object has three instance variables:
|
|
72
|
+
|
|
73
|
+
`func`: the function that was decorated
|
|
74
|
+
|
|
75
|
+
`params`: the input `params` argument in the decoration, `None` if none was given.
|
|
76
|
+
|
|
77
|
+
`kwparams`: the input `kwparams` argument in the decoration, `None` if none was given.
|
|
78
|
+
|
|
79
|
+
The `ParamFunc` object can be called as a function. It will take the arguments given it, convert them using the related `"convert"` functions, and check them against any related `"params"` functions with `assert param(converted_argument)`.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# paramfunc
|
|
2
|
+
Decorator and class for easy argument conversion and validation..
|
|
3
|
+
|
|
4
|
+
Github: [link](https://github.com/Lightseeker7/paramfunc)
|
|
5
|
+
|
|
6
|
+
Project: [link](https://pypi.org/project/paramfunc/)
|
|
7
|
+
|
|
8
|
+
# @parameterize
|
|
9
|
+
The function decorator takes up to two arguments, `params` and `kwparams`, and converts the function into a callable `ParamFunc` object. This `ParamFunc` object can be called as a normal function can, only it will first convert the arguments and check them against any related parameters.
|
|
10
|
+
|
|
11
|
+
Formatted as follows:
|
|
12
|
+
```
|
|
13
|
+
@parameterize(params=<params>,kwparams=<kwparams>)
|
|
14
|
+
def my_func(arg1,arg2):
|
|
15
|
+
return arg1 + arg2
|
|
16
|
+
```
|
|
17
|
+
In the event a converted argument does not satisfy a parameter, it will throw an error. Any errors involved with converting the argument will also occur, where applicable.
|
|
18
|
+
## params
|
|
19
|
+
Set to `None` if none are given.
|
|
20
|
+
|
|
21
|
+
`params` is used for all positional-only arguments, what would be called with `*args`
|
|
22
|
+
|
|
23
|
+
The format for `params` is a `dict` object formatted like the following:
|
|
24
|
+
```
|
|
25
|
+
{"convert":convert,"params":[boolean functions]}
|
|
26
|
+
```
|
|
27
|
+
An example of a `params` argument that converts all input items in `*args` to `int` objects and checks if they are even and not negative:
|
|
28
|
+
```
|
|
29
|
+
{"convert":int,"params":[lambda x:x>=0,lambda x:x%2==0]}
|
|
30
|
+
```
|
|
31
|
+
## kwparams
|
|
32
|
+
Set to `None` if none are given.
|
|
33
|
+
|
|
34
|
+
`kwparams` is used for all other arguments, whether they are keyword-only or positional with a keyword.
|
|
35
|
+
|
|
36
|
+
The format for `kwparams` is a `dict` object formatted like the following:
|
|
37
|
+
```
|
|
38
|
+
{"keyword1":{"convert":convert,"params":[boolean functions]},"keyword2":{"convert":convert,"params":[boolean functions]}}
|
|
39
|
+
```
|
|
40
|
+
An example of a `kwparams` argument that checks if the `"file"` argument is a .txt file and the `"contents"` is a list of strings:
|
|
41
|
+
```
|
|
42
|
+
{"file":{"convert":str,"params":[lambda x:x[-4:]==".txt",lambda x:len(x)>=5]},"contents":{"convert":list,"params":[lambda x:all(isinstance(item,str) for item in x)]}}
|
|
43
|
+
```
|
|
44
|
+
If a keyword argument has no need for conversion or for checking against a variable, it can be omitted from `kwparams`.
|
|
45
|
+
## "convert"
|
|
46
|
+
`"convert"` can be a `type` object such as `int` or `str`, or it can be any function that takes the related argument and returns a value. This can be a `lambda` or a function defined elsewhere in the program. If no change should happen to the related argument(s), but there still needs to be `"params"` for it, it should be set to the following:
|
|
47
|
+
```
|
|
48
|
+
"convert":lambda x:x
|
|
49
|
+
```
|
|
50
|
+
## "params"
|
|
51
|
+
`"params"` is a list of functions that all must return boolean values. These can be `lambda` functions or functions defined elsewhere in the program. If no parameters are needed for the argument, but it needs to be converted with `"convert"`, it should just be set to an empty list:
|
|
52
|
+
```
|
|
53
|
+
"params":[]
|
|
54
|
+
```
|
|
55
|
+
# ParamFunc
|
|
56
|
+
`@paramterize` converts the function it is decorating into a `ParamFunc` object. This object has three instance variables:
|
|
57
|
+
|
|
58
|
+
`func`: the function that was decorated
|
|
59
|
+
|
|
60
|
+
`params`: the input `params` argument in the decoration, `None` if none was given.
|
|
61
|
+
|
|
62
|
+
`kwparams`: the input `kwparams` argument in the decoration, `None` if none was given.
|
|
63
|
+
|
|
64
|
+
The `ParamFunc` object can be called as a function. It will take the arguments given it, convert them using the related `"convert"` functions, and check them against any related `"params"` functions with `assert param(converted_argument)`.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools >= 77.0.3"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
[project]
|
|
5
|
+
name = "paramfunc"
|
|
6
|
+
version = "0.0.1"
|
|
7
|
+
authors = [
|
|
8
|
+
{ name="light.seeker", email="light.the.seeker@gmail.com" },
|
|
9
|
+
]
|
|
10
|
+
description = "Decorator and class for easy argument conversion and validation."
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
requires-python = ">=3.9"
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
]
|
|
17
|
+
license = "MIT"
|
|
18
|
+
license-files = ["LICEN[CS]E*"]
|
|
19
|
+
|
|
20
|
+
[project.urls]
|
|
21
|
+
Homepage = "https://pypi.org/project/paramfunc/"
|
|
22
|
+
Repository = "https://github.com/Lightseeker7/paramfunc"
|
|
File without changes
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: paramfunc
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Decorator and class for easy argument conversion and validation.
|
|
5
|
+
Author-email: "light.seeker" <light.the.seeker@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://pypi.org/project/paramfunc/
|
|
8
|
+
Project-URL: Repository, https://github.com/Lightseeker7/paramfunc
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE.txt
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# paramfunc
|
|
17
|
+
Decorator and class for easy argument conversion and validation..
|
|
18
|
+
|
|
19
|
+
Github: [link](https://github.com/Lightseeker7/paramfunc)
|
|
20
|
+
|
|
21
|
+
Project: [link](https://pypi.org/project/paramfunc/)
|
|
22
|
+
|
|
23
|
+
# @parameterize
|
|
24
|
+
The function decorator takes up to two arguments, `params` and `kwparams`, and converts the function into a callable `ParamFunc` object. This `ParamFunc` object can be called as a normal function can, only it will first convert the arguments and check them against any related parameters.
|
|
25
|
+
|
|
26
|
+
Formatted as follows:
|
|
27
|
+
```
|
|
28
|
+
@parameterize(params=<params>,kwparams=<kwparams>)
|
|
29
|
+
def my_func(arg1,arg2):
|
|
30
|
+
return arg1 + arg2
|
|
31
|
+
```
|
|
32
|
+
In the event a converted argument does not satisfy a parameter, it will throw an error. Any errors involved with converting the argument will also occur, where applicable.
|
|
33
|
+
## params
|
|
34
|
+
Set to `None` if none are given.
|
|
35
|
+
|
|
36
|
+
`params` is used for all positional-only arguments, what would be called with `*args`
|
|
37
|
+
|
|
38
|
+
The format for `params` is a `dict` object formatted like the following:
|
|
39
|
+
```
|
|
40
|
+
{"convert":convert,"params":[boolean functions]}
|
|
41
|
+
```
|
|
42
|
+
An example of a `params` argument that converts all input items in `*args` to `int` objects and checks if they are even and not negative:
|
|
43
|
+
```
|
|
44
|
+
{"convert":int,"params":[lambda x:x>=0,lambda x:x%2==0]}
|
|
45
|
+
```
|
|
46
|
+
## kwparams
|
|
47
|
+
Set to `None` if none are given.
|
|
48
|
+
|
|
49
|
+
`kwparams` is used for all other arguments, whether they are keyword-only or positional with a keyword.
|
|
50
|
+
|
|
51
|
+
The format for `kwparams` is a `dict` object formatted like the following:
|
|
52
|
+
```
|
|
53
|
+
{"keyword1":{"convert":convert,"params":[boolean functions]},"keyword2":{"convert":convert,"params":[boolean functions]}}
|
|
54
|
+
```
|
|
55
|
+
An example of a `kwparams` argument that checks if the `"file"` argument is a .txt file and the `"contents"` is a list of strings:
|
|
56
|
+
```
|
|
57
|
+
{"file":{"convert":str,"params":[lambda x:x[-4:]==".txt",lambda x:len(x)>=5]},"contents":{"convert":list,"params":[lambda x:all(isinstance(item,str) for item in x)]}}
|
|
58
|
+
```
|
|
59
|
+
If a keyword argument has no need for conversion or for checking against a variable, it can be omitted from `kwparams`.
|
|
60
|
+
## "convert"
|
|
61
|
+
`"convert"` can be a `type` object such as `int` or `str`, or it can be any function that takes the related argument and returns a value. This can be a `lambda` or a function defined elsewhere in the program. If no change should happen to the related argument(s), but there still needs to be `"params"` for it, it should be set to the following:
|
|
62
|
+
```
|
|
63
|
+
"convert":lambda x:x
|
|
64
|
+
```
|
|
65
|
+
## "params"
|
|
66
|
+
`"params"` is a list of functions that all must return boolean values. These can be `lambda` functions or functions defined elsewhere in the program. If no parameters are needed for the argument, but it needs to be converted with `"convert"`, it should just be set to an empty list:
|
|
67
|
+
```
|
|
68
|
+
"params":[]
|
|
69
|
+
```
|
|
70
|
+
# ParamFunc
|
|
71
|
+
`@paramterize` converts the function it is decorating into a `ParamFunc` object. This object has three instance variables:
|
|
72
|
+
|
|
73
|
+
`func`: the function that was decorated
|
|
74
|
+
|
|
75
|
+
`params`: the input `params` argument in the decoration, `None` if none was given.
|
|
76
|
+
|
|
77
|
+
`kwparams`: the input `kwparams` argument in the decoration, `None` if none was given.
|
|
78
|
+
|
|
79
|
+
The `ParamFunc` object can be called as a function. It will take the arguments given it, convert them using the related `"convert"` functions, and check them against any related `"params"` functions with `assert param(converted_argument)`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"""Decorator and class for easy argument conversion and validation."""
|
|
2
|
+
|
|
3
|
+
def parameterize(params:list|None=None,kwparams:dict|None=None):
|
|
4
|
+
"""
|
|
5
|
+
Decorator function that converts the function into a callable ParamFunc object
|
|
6
|
+
|
|
7
|
+
Format of params argument:
|
|
8
|
+
{convert,[boolean functions]}
|
|
9
|
+
e.g.
|
|
10
|
+
{str,[lambda x:x[-4:]==".txt",lambda x:len(x)>=5]}
|
|
11
|
+
Format of kwparams argument:
|
|
12
|
+
{"key word":{"convert":convert,"params":[boolean functions]}}
|
|
13
|
+
e.g.
|
|
14
|
+
{"num1":{"convert":int,"params":[lambda x:x%3==0, lambda x:x>=0]}}
|
|
15
|
+
|
|
16
|
+
convert can be any function that takes an argument and returns a converted argument (use lambda x:x if it needs to stay the same)
|
|
17
|
+
boolean functions can be lambdas or any function that takes the converted argument and returns a boolean
|
|
18
|
+
|
|
19
|
+
key word arguments with no conversion functions or parameters can be left empty
|
|
20
|
+
"""
|
|
21
|
+
def create_param_func(func:function):
|
|
22
|
+
return ParamFunc(func,params=params,kwparams=kwparams)
|
|
23
|
+
return create_param_func
|
|
24
|
+
|
|
25
|
+
class ParamFunc:
|
|
26
|
+
|
|
27
|
+
def __init__(self,func:function,params:list|None=None,kwparams:dict|None=None):
|
|
28
|
+
"""
|
|
29
|
+
Format of params argument:
|
|
30
|
+
{"convert":convert,"params":[boolean functions]}
|
|
31
|
+
e.g.
|
|
32
|
+
{"convert":str,"params":[lambda x:x[-4:]==".txt",lambda x:len(x)>=5]}
|
|
33
|
+
Format of kwparams argument:
|
|
34
|
+
{"key word":{"convert":convert,"params":[boolean functions]}}
|
|
35
|
+
e.g.
|
|
36
|
+
{"num1":{"convert":int,"params":[lambda x:x%3==0, lambda x:x>=0]}}
|
|
37
|
+
|
|
38
|
+
convert can be any function that takes an argument and returns a converted argument (use lambda x:x if it needs to stay the same)
|
|
39
|
+
boolean functions can be lambdas or any function that takes the converted argument and returns a boolean
|
|
40
|
+
"""
|
|
41
|
+
self.func = func
|
|
42
|
+
self.params = params
|
|
43
|
+
self.kwparams = kwparams
|
|
44
|
+
|
|
45
|
+
def __call__(self, *args, **kwargs):
|
|
46
|
+
varnames = self.func.__code__.co_varnames[:self.func.__code__.co_argcount] # will be () if none
|
|
47
|
+
def_var = self.func.__defaults__ # will be None if none
|
|
48
|
+
kw_def_var = self.func.__kwdefaults__ # will be None if none
|
|
49
|
+
|
|
50
|
+
converted_kwargs = {}
|
|
51
|
+
|
|
52
|
+
if kw_def_var != None:
|
|
53
|
+
for kw_var in kw_def_var.items():
|
|
54
|
+
converted_kwargs[kw_var[0]] = kw_var[1]
|
|
55
|
+
|
|
56
|
+
if def_var != None:
|
|
57
|
+
for var in range(-1,-1*len(def_var)-1,-1):
|
|
58
|
+
converted_kwargs[varnames[var]] = def_var[var]
|
|
59
|
+
|
|
60
|
+
if len(varnames) > 0:
|
|
61
|
+
if self.kwparams != None:
|
|
62
|
+
for var in range(len(args)):
|
|
63
|
+
if varnames[var] in self.kwparams.keys():
|
|
64
|
+
converted_arg = self.kwparams[varnames[var]]["convert"](args[var])
|
|
65
|
+
for param in self.kwparams[varnames[var]]["params"]:
|
|
66
|
+
assert param(converted_arg), f"arg {args[var]} doesn't satisfy parameter(s)"
|
|
67
|
+
converted_kwargs[varnames[var]] = converted_arg
|
|
68
|
+
else:
|
|
69
|
+
converted_kwargs[varnames[var]] = args[var]
|
|
70
|
+
else:
|
|
71
|
+
for var in range(len(args)):
|
|
72
|
+
converted_kwargs[varnames[var]] = args[var]
|
|
73
|
+
args = args[len(varnames):]
|
|
74
|
+
|
|
75
|
+
converted_args = []
|
|
76
|
+
|
|
77
|
+
if self.params != None:
|
|
78
|
+
for arg in args:
|
|
79
|
+
converted_arg = self.params["convert"](arg)
|
|
80
|
+
for param in self.params["params"]:
|
|
81
|
+
assert param(converted_arg), f"arg {arg} doesn't satisfy parameter(s)"
|
|
82
|
+
converted_args.append(converted_arg)
|
|
83
|
+
else:
|
|
84
|
+
converted_args = args
|
|
85
|
+
|
|
86
|
+
if self.kwparams != None:
|
|
87
|
+
for kwarg in kwargs.items():
|
|
88
|
+
if kwarg[0] in self.kwparams.keys():
|
|
89
|
+
converted_kwarg = self.kwparams[kwarg[0]]["convert"](kwarg[1])
|
|
90
|
+
for param in self.kwparams[kwarg[0]]["params"]:
|
|
91
|
+
assert param(converted_kwarg), f"arg {kwarg[1]} doesn't satisfy parameter(s)"
|
|
92
|
+
converted_kwargs[kwarg[0]] = converted_kwarg
|
|
93
|
+
else:
|
|
94
|
+
converted_kwargs[kwarg[0]] = kwarg[1]
|
|
95
|
+
else:
|
|
96
|
+
for kwarg in kwargs.items():
|
|
97
|
+
converted_kwargs[kwarg[0]] = kwarg[1]
|
|
98
|
+
|
|
99
|
+
return self.func(*converted_args,**converted_kwargs)
|