mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 04:52:23 +08:00
Consider __doc__ always Optional. (#641)
python/mypy#2380 showed a discrepancy between object and FunctionType in stdlib2. The first defined __doc__ to be str, the second Optional[str]. As FunctionType depends on object, this is no longer valid. As suggested by @gvanrossum in python/mypy#2380, all __doc__ should be considered Optional. (Final verdict was just to remove most __doc__ attributes since it's inherited from object.)
This commit is contained in:
committed by
Guido van Rossum
parent
1d47c6fdb8
commit
15ec66cdd6
@@ -48,7 +48,6 @@ def as_interface(obj, cls=..., methods=..., required=...): ...
|
||||
|
||||
class memoized_property:
|
||||
fget = ... # type: Any
|
||||
__doc__ = ... # type: Any
|
||||
__name__ = ... # type: Any
|
||||
def __init__(self, fget, doc=...) -> None: ...
|
||||
def __get__(self, obj, cls): ...
|
||||
@@ -92,7 +91,6 @@ def assert_arg_type(arg, argtype, name): ...
|
||||
def dictlike_iteritems(dictlike): ...
|
||||
|
||||
class classproperty:
|
||||
__doc__ = ... # type: Any
|
||||
def __init__(self, fget, *arg, **kw) -> None: ...
|
||||
def __get__(desc, self, cls): ...
|
||||
|
||||
|
||||
2
third_party/3/typed_ast/ast27.pyi
vendored
2
third_party/3/typed_ast/ast27.pyi
vendored
@@ -2,12 +2,10 @@ import typing
|
||||
from typing import Any, Optional, Union, Generic, Iterator
|
||||
|
||||
class NodeVisitor():
|
||||
__doc__ = ... # type: str
|
||||
def visit(self, node: AST) -> Any: ...
|
||||
def generic_visit(self, node: AST) -> None: ...
|
||||
|
||||
class NodeTransformer(NodeVisitor):
|
||||
__doc__ = ... # type: str
|
||||
def generic_visit(self, node: AST) -> None: ...
|
||||
|
||||
def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ...
|
||||
|
||||
2
third_party/3/typed_ast/ast35.pyi
vendored
2
third_party/3/typed_ast/ast35.pyi
vendored
@@ -2,12 +2,10 @@ import typing
|
||||
from typing import Any, Optional, Union, Generic, Iterator
|
||||
|
||||
class NodeVisitor():
|
||||
__doc__ = ... # type: str
|
||||
def visit(self, node: AST) -> Any: ...
|
||||
def generic_visit(self, node: AST) -> None: ...
|
||||
|
||||
class NodeTransformer(NodeVisitor):
|
||||
__doc__ = ... # type: str
|
||||
def generic_visit(self, node: AST) -> None: ...
|
||||
|
||||
def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ...
|
||||
|
||||
Reference in New Issue
Block a user