Replies: 2 comments 1 reply
-
|
What are you trying to accomplish? The purpose of
So fundamentally what's going wrong is that you created a function that only takes If you're in a notebook, the IPython kernel will show the signature if you just type the function name ( |
Beta Was this translation helpful? Give feedback.
-
|
I was looking for a kwargs alternative i.e. trying to dynamically alter the signature of a function as shown in this link - https://tommasoamici.com/blog/dynamically-change-signature-function-python/ and maybe I mis understood the comment in the code " Dynamically add new parameters for lat, lon, and crs to the function signature I guess it cannot add anything else other than lat, lon and crs. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to get a minimum working example of parse_grid_arguments and I have encountered an error using it
Here is my toy example -
and I get this error -
File "/home/winash12/testpython/testmetpydec.py", line 16, in <module> main() File "/home/winash12/testpython/testmetpydec.py", line 15, in main test_decorator(a,b,uwnd) File "/usr/local/lib/python3.9/dist-packages/metpy/calc/tools.py", line 1032, in wrapper bound_args = newsig.bind(*args, **kwargs) File "/usr/lib/python3.9/inspect.py", line 3062, in bind return self._bind(args, kwargs) File "/usr/lib/python3.9/inspect.py", line 2988, in _bind raise TypeError( TypeError: too many positional argumentsWhere am I going wrong ?
Beta Was this translation helpful? Give feedback.
All reactions