py2api 0.0.4__tar.gz → 0.0.5__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.
- {py2api-0.0.4 → py2api-0.0.5}/PKG-INFO +1 -1
- {py2api-0.0.4 → py2api-0.0.5}/py2api/util.py +15 -3
- {py2api-0.0.4 → py2api-0.0.5}/pyproject.toml +1 -1
- {py2api-0.0.4 → py2api-0.0.5}/.editorconfig +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/.github/workflows/ci.yml +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/.gitignore +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/.idea/misc.xml +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/.idea/modules.xml +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/.idea/py2api.iml +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/.idea/vcs.xml +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/.idea/workspace.xml +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/LICENSE +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/README.md +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/docsrc/.gitignore +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/docsrc/Makefile +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/docsrc/conf.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/docsrc/index.rst +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/docsrc/make.bat +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/.gitignore +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/__init__.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/constants.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/defaults.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/errors.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/examples/__init__.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/examples/pong.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/examples/streaming_sine.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/examples/wrapping_a_class.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/examples/wrapping_a_module.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/obj_wrap.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/output_trans.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/py2rest/__init__.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/py2rest/app_maker.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/py2rest/constants.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/py2rest/input_trans.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/py2rest/obj_wrap.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/py2rest/old/old_input_trans_with_val_type.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/py2rest/rest2py.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/scrap_obj_wrap.py +0 -0
- {py2api-0.0.4 → py2api-0.0.5}/py2api/tests/wrapping_a_class.py +0 -0
|
@@ -45,7 +45,15 @@ def enhanced_docstr(func):
|
|
|
45
45
|
>>> print(enhanced_docstr(foo))
|
|
46
46
|
foo(a, b=3, c="as", d=SomeClass, dd=some_function, ddd=None, *args, **kwargs)
|
|
47
47
|
some documentation...
|
|
48
|
-
|
|
48
|
+
|
|
49
|
+
A function with no default arguments keeps all of its positional args
|
|
50
|
+
(regression: ``args[:-len(dflts)]`` used to drop them all when ``dflts`` was empty):
|
|
51
|
+
|
|
52
|
+
>>> def no_defaults(a, b, c):
|
|
53
|
+
... '''some docs'''
|
|
54
|
+
>>> print(enhanced_docstr(no_defaults))
|
|
55
|
+
no_defaults(a, b, c)
|
|
56
|
+
some docs
|
|
49
57
|
"""
|
|
50
58
|
argspec = getfullargspec(func)
|
|
51
59
|
|
|
@@ -53,9 +61,13 @@ def enhanced_docstr(func):
|
|
|
53
61
|
dflts = list(map(_strigify_val, dflts))
|
|
54
62
|
|
|
55
63
|
args_strings = list()
|
|
56
|
-
|
|
64
|
+
# Number of positional (non-default) args. Computed as a length so that the
|
|
65
|
+
# no-defaults case works: with len(dflts)==0, args[:-0] would wrongly be []
|
|
66
|
+
# (since -0 == 0), dropping every positional arg.
|
|
67
|
+
n_positional = len(argspec.args) - len(dflts)
|
|
68
|
+
args_strings += argspec.args[:n_positional]
|
|
57
69
|
args_strings += [
|
|
58
|
-
"{}={}".format(*x) for x in zip(argspec.args[
|
|
70
|
+
"{}={}".format(*x) for x in zip(argspec.args[n_positional:], dflts)
|
|
59
71
|
]
|
|
60
72
|
if argspec.varargs is not None:
|
|
61
73
|
args_strings += [f"*{argspec.varargs}"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|