Parameter validation is currently handled by function decorators. This has the following downsides:
A. Required parameters are defined with '=None'.
This is really non-pythonic and unhelpful to IDEs and (more) experienced programmers.
Required arguments should never have a default value.
B. Debugging the function calls is more-or-less impossible.
If you try to PDB into an plone.api function, the only thing you'll see is '(1)create()'. This is the same problem we have with TTW python scripts.
There's also the overhead of function calls, but that's clearly moot when you're creating content, or doing a workflow transition.
Parameter validation is currently handled by function decorators. This has the following downsides:
A. Required parameters are defined with '=None'.
This is really non-pythonic and unhelpful to IDEs and (more) experienced programmers.
Required arguments should never have a default value.
B. Debugging the function calls is more-or-less impossible.
If you try to PDB into an plone.api function, the only thing you'll see is '(1)create()'. This is the same problem we have with TTW python scripts.
There's also the overhead of function calls, but that's clearly moot when you're creating content, or doing a workflow transition.