The parameter validation decorators should be reworked.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 101
- Forks
- 62
- Avg merge
- 15h 15m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the function decorators that handle parameter validation and the affected plone.api functions; the issue does not name specific files or tests. Establish the replacement design for required arguments and debuggable calls, then add or update coverage showing both behaviors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend-api-design
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100