Renamed: Better form arguments and docstrings.
See original GitHub issueWhen defining bilinear forms you always write
@bilinear_form
def bilin(u, du, v, dv, w):
pass
namely, the function arguments are in the same order always.
It would be convenient to have a snippet like this and other examples available in the docstring(s) of bilinear_form (and linear_form) so it can be quickly copy-pasted from REPL (help(bilinear_form)) without remembering the order of arguments and what w contains.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Writing Functions in Python.txt - GitHub
We'll cover docstrings and why they matter and how to know when you need to turn a chunk of code into a function....
Read more >11 Comments, Docstrings, and Type Hints - Invent with Python
Type hints are directives you can add to your Python source code to specify the data types of variables, parameters, and return values....
Read more >Writing Functions In Python - Hylke Rozema
Now add the arguments section, using the Google style for docstrings. Use str to indicate a string. Add a returns section that informs...
Read more >How to document a method with parameter(s)? - Stack Overflow
Since docstrings are free-form, it really depends on what you use to parse code to generate API documentation.
Read more >Documenting Python APIs with Docstrings
Python docstrings form the __doc__ attributes attached to modules, ... When two or more consecutive input parameters have exactly the same type, shape...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Random idea: we could also directly modify AST in the decorators to transform u into u[0] using NodeTransformer (and pretty much arbitrary substitutions).
This was done a while ago, new forms will be released in
1.0.0
.