Open jaroel opened 9 years ago
Point A is easily fixed by remove the '=None' for required parameters. Point B can be resolved by moving the decorators' functionality inside the functions.
:+1: for removing the decorators. They are nice when programming plone.api but really annoying when using and debugging it.
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.