Comment écrire des commentaires de document Python (Docstrings). Salut, une faction? école? Il semble y avoir.
Style NumPy.py
def add(a, b):
"""The sum of two numbers.
"""
Style Google.py
def add(a, b):
"""The sum of two numbers.
"""
Style NumPy.py
def add(a, b):
"""The sum of two numbers.
(Extended Summary)
"""
Style Google.py
def add(a, b):
"""The sum of two numbers.
(Extended Summary)
"""
Style NumPy.py
"""
Parameters
----------
x : type
Description of parameter `x`.
y
Description of parameter `y` (with type not specified)
"""
Style Google.py
"""
Args:
x (type): Description of parameter `x`.
y: Description of parameter `y` (with type not specified)
"""
Style NumPy.py
"""
Returns
-------
int
Description of anonymous integer return value.
"""
Style NumPy.py
"""
Returns
-------
err_code : int
Non-zero value indicates error code, or zero on success.
err_msg : str or None
Human readable error message, or None on success.
"""
Style Google.py
"""
Returns:
int: Description of anonymous integer return value.
"""
Style NumPy.py
"""
Raises
------
LinAlgException
If the matrix is not numerically invertible.
"""
Style Google.py
"""
Raises:
LinAlgException: If the matrix is not numerically invertible.
"""
Style NumPy.py
"""
See Also
--------
average : Weighted average
"""
Style Google.py
#Aucun
Style NumPy.py
"""
Notes
----------
The FFT is a fast implementation of the discrete Fourier transform:
.. math:: X(e^{j\omega } ) = x(n)e^{ - j\omega n}
"""
Style Google.py
"""
Note:
The FFT is a fast implementation of the discrete Fourier transform:
.. math:: X(e^{j\omega } ) = x(n)e^{ - j\omega n}
"""
Style NumPy.py
"""
Examples
----------
>>> np.add(1, 2)
3
"""
Style Google.py
"""
Example:
>>> np.add(1, 2)
3
"""
Style NumPy.py
"""
Attributes
----------
x : float
The X coordinate.
y : float
The Y coordinate.
"""
Style Google.py
"""
Attributes:
x (float): The X coordinate.
y (float): The Y coordinate.
"""
Style NumPy.py
"""
Methods
-------
colorspace(c='rgb')
Represent the photo in the given colorspace.
gamma(n=1.0)
Change the photo's gamma exposure.
"""
Style Google.py
#Aucun