Comments (12)
Other popular docstring syntax to document function parameter is numpydocs https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt#id6
from jedi.
I've had this idea once before, but at the moment I don't have the time to add this, could be a good addition.
from jedi.
Are there any other (popular) ways to declare types for python params?
from jedi.
I found something: http://www.python.org/dev/peps/pep-0257/ (but I really would like to know about other types).
from jedi.
There are also "googley" docstrings:
"""This function does something.
Args:
name (str): The name to use.
Kwargs:
state (bool): Current state to be in.
Returns:
int. The return code::
0 -- Success!
1 -- No good.
2 -- Try again.
Raises:
AttributeError, KeyError
"""
from jedi.
No, I don't know other styles (including that google style!). I think Sphinx is a good first step, as I assume it is the most famous and used style and you can use docutils instead of writing your own.
from jedi.
In matplotlib, ReST table is used for documenting keyword arguments. But I guess supporting this style won't help people other than matplotlib devs.
================ =========================================
Keyword Description
================ =========================================
*adjustable* [ 'box' | 'datalim' | 'box-forced']
*alpha* float: the alpha transparency (can be None)
*anchor* [ 'C', 'SW', 'S', 'SE', 'E', 'NE', 'N',
'NW', 'W' ]
*aspect* [ 'auto' | 'equal' | aspect_ratio ]
*autoscale_on* [ *True* | *False* ] whether or not to
autoscale the *viewlim*
...
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes.py#L392-433
from jedi.
I added sphinx docstrings and "googley" docstrings. I ignored the matplotlib ones because they are not typical for Python and also ignored numpy docstrings (for now) because they might be misinterpreted.
from jedi.
This is really cool! Thank you very much.
from jedi.
It's really only the basics, I have to improve things like list of str
...
from jedi.
I didn't found any definition of googley docstrings
. The only tink I found is http://google-styleguide.googlecode.com/svn/trunk/pyguide.html#Comments which does not provide any format for param types or return types.
I'd like to remove google docstrings support to keep existing code clean and simple. Unless someone provide docstrings api(format) atleast.
from jedi.
You're probably right. The reason why I included it in the first place was this: http://packages.python.org/an_example_pypi_project/sphinx.html
But that's just an example. No specification. So feel free to remove it.
from jedi.
Related Issues (20)
- Add support for async pytest fixtures
- Is it possible to generate completion for `argparse.Namespace`? HOT 5
- TypedDict : Suggestion issues HOT 2
- Python stubs loaded from extensions folder even when using an explicit interpreter HOT 8
- Error when trying to detect environment HOT 5
- `PathFinder` has no attribute `find_module` in `python 12.2` HOT 2
- Questions about Copilot + Open Source Software Hierarchy HOT 1
- What exactly does "smart_sys_path" do? HOT 5
- Completion fails when variable name is identical to type name HOT 4
- 'TreeInstance' object has no attribute 'with_generics' when using typing.Literal["str"] return annotation on property HOT 4
- How to discover the import statement for a particular Name? HOT 4
- Does Jedi support type inference for type annotations that include generics? HOT 2
- _get_executable_path() can't get the correct path on Windows Anaconda
- Issues with pytest 8 HOT 1
- [Feature request] Support for syntax coloring (based on symbol type) HOT 1
- Script.infer() unexpectedly returns empty list HOT 10
- Jedi outputs: Syntax Error Invalid Syntax HOT 2
- [Feature Request]: infer the return type of functions HOT 1
- Any type inference error HOT 6
- `test_completion_param_annotations` fails in Python 3.13 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jedi.