Function bodies should be empty (#959)

I've seen some stubs like

```
class X:
    def __init__(self, x: str) -> None:
        self.x = x
        self.y = 0
```
I think this should be written instead as
```
class X:
    x: str
    y: int
    def __init__(self, x: str) -> None: ...
```
This commit is contained in:
Jelle Zijlstra
2017-03-10 15:35:34 -08:00
committed by Guido van Rossum
parent bd5b33f3b1
commit d04b9b204e

View File

@@ -127,6 +127,7 @@ Style conventions for stub files are different from PEP 8. The general
rule is that they should be as concise as possible. Specifically:
* there is no line length limit;
* prefer long lines over elaborate indentation;
* all function bodies should be empty;
* prefer ``...`` over ``pass``;
* prefer ``...`` on the same line as the class/function signature;
* avoid vertical whitespace between consecutive module-level functions,