# Arguments on first line forbidden when not using vertical alignment.
# Arguments on first line forbidden when not using vertical alignment.
foo=long_function_name(var_one,var_two,
foo=long_function_name(var_one,var_two,
var_three,var_four)
var_three,var_four)
# Further indentation required as indentation is not distinguishable.
# Further indentation required as indentation is not distinguishable.
deflong_function_name(
deflong_function_name(
var_one,var_two,var_three,
var_one,var_two,var_three,
var_four):
var_four):
print(var_one)
print(var_one)
```
```
...
@@ -100,17 +86,14 @@ For flowing long blocks of text with fewer structural restrictions (docstrings o
...
@@ -100,17 +86,14 @@ For flowing long blocks of text with fewer structural restrictions (docstrings o
### A Line Should Break Before a Binary Operator?
### A Line Should Break Before a Binary Operator?
`# easy to match operators with operands`
```python
# easy to match operators with operands
`income = (gross_wages`
income=(gross_wages
+taxable_interest
` + taxable_interest`
+(dividends-qualified_dividends)
-ira_deduction
` + (dividends - qualified_dividends)`
-student_loan_interest)
```
` - ira_deduction`
` - student_loan_interest)`
### Blank lines
### Blank lines
...
@@ -204,11 +187,11 @@ The documentation will follow the (numpy convention )\[<https://numpydoc.readthe
...
@@ -204,11 +187,11 @@ The documentation will follow the (numpy convention )\[<https://numpydoc.readthe
A one-line summary that does not use variable names or the function name, e.g.
A one-line summary that does not use variable names or the function name, e.g.
`def add(a, b):`
```python
defadd(a,b):
` """The sum of two numbers.`
"""The sum of two numbers.
"""
` """`
```
#### Extended Summary
#### Extended Summary
...
@@ -218,37 +201,29 @@ A few sentences giving an extended description. This section should be used to c
...
@@ -218,37 +201,29 @@ A few sentences giving an extended description. This section should be used to c
Description of the function arguments, keywords and their respective types.
Description of the function arguments, keywords and their respective types.
`Parameters`
```python
Parameters
`----------`
----------
x:type
`x : type`
Descriptionofparameterx.
y
` Description of parameter x.`
Descriptionofparametery (withtypenotspecified).
```
`y`
` Description of parameter y (with type not specified).`
Enclose variables in single backticks. The colon must be preceded by a space, or omitted if the type is absent.
Enclose variables in single backticks. The colon must be preceded by a space, or omitted if the type is absent.
For the parameter types, be as precise as possible. Below are a few examples of parameters and their types.
For the parameter types, be as precise as possible. Below are a few examples of parameters and their types.
`Parameters`
```python
Parameters
`----------`
----------
filename:str
`filename : str`
copy:bool
dtype:data-type
`copy : bool`
iterable:iterableobject
shape:intortupleofint
`dtype : data-type`
files:listofstr
```
`iterable : iterable object`
`shape : int or tuple of int`
`files : list of str`
If it is not necessary to specify a keyword argument, use optional :
If it is not necessary to specify a keyword argument, use optional :
...
@@ -258,25 +233,23 @@ If it is not necessary to specify a keyword argument, use optional :
...
@@ -258,25 +233,23 @@ If it is not necessary to specify a keyword argument, use optional :
Explanation of the returned values and their types. Similar to the [<span dir="">Parameters</span>](https://numpydoc.readthedocs.io/en/latest/format.html#params) section, except the name of each return value is optional. The type of each return value is always required:
Explanation of the returned values and their types. Similar to the [<span dir="">Parameters</span>](https://numpydoc.readthedocs.io/en/latest/format.html#params) section, except the name of each return value is optional. The type of each return value is always required:
`Returns`
```python
Returns
`-------`
-------
int
`int`
Descriptionofanonymousintegerreturnvalue.
```
` Description of anonymous integer return value.`
#### Yields
#### Yields
Explanation of the yielded values and their types. This is relevant to generators only. Similar to the [<span dir="">Returns</span>](https://numpydoc.readthedocs.io/en/latest/format.html#returns) section in that the name of each value is optional, but the type of each value is always required:
Explanation of the yielded values and their types. This is relevant to generators only. Similar to the [<span dir="">Returns</span>](https://numpydoc.readthedocs.io/en/latest/format.html#returns) section in that the name of each value is optional, but the type of each value is always required:
`Yields`
```python
Yields
`------`
------
int
`int`
Descriptionoftheanonymousintegerreturnvalue.
```
` Description of the anonymous integer return value.`
####
####
...
@@ -284,19 +257,20 @@ Explanation of the yielded values and their types. This is relevant to generator
...
@@ -284,19 +257,20 @@ Explanation of the yielded values and their types. This is relevant to generator
An optional section that provides additional information about the code, possibly including a discussion of the algorithm.
An optional section that provides additional information about the code, possibly including a discussion of the algorithm.