mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
more 3.7 features (#2017)
This commit is contained in:
committed by
Guido van Rossum
parent
7cfbc7d17f
commit
0acdfd1548
@@ -27,7 +27,10 @@ if sys.version_info >= (3, 4):
|
||||
def calcsize(fmt: _FmtType) -> int: ...
|
||||
|
||||
class Struct:
|
||||
format = ... # type: bytes
|
||||
if sys.version_info >= (3, 7):
|
||||
format: str
|
||||
else:
|
||||
format: bytes
|
||||
size = ... # type: int
|
||||
|
||||
def __init__(self, format: _FmtType) -> None: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Python 3.5 _ast
|
||||
import sys
|
||||
import typing
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
@@ -16,6 +16,8 @@ class mod(AST):
|
||||
|
||||
class Module(mod):
|
||||
body = ... # type: typing.List[stmt]
|
||||
if sys.version_info >= (3, 7):
|
||||
docstring: Optional[str]
|
||||
|
||||
class Interactive(mod):
|
||||
body = ... # type: typing.List[stmt]
|
||||
@@ -37,6 +39,8 @@ class FunctionDef(stmt):
|
||||
body = ... # type: typing.List[stmt]
|
||||
decorator_list = ... # type: typing.List[expr]
|
||||
returns = ... # type: Optional[expr]
|
||||
if sys.version_info >= (3, 7):
|
||||
docstring: Optional[str]
|
||||
|
||||
class AsyncFunctionDef(stmt):
|
||||
name = ... # type: _identifier
|
||||
@@ -44,6 +48,8 @@ class AsyncFunctionDef(stmt):
|
||||
body = ... # type: typing.List[stmt]
|
||||
decorator_list = ... # type: typing.List[expr]
|
||||
returns = ... # type: Optional[expr]
|
||||
if sys.version_info >= (3, 7):
|
||||
docstring: Optional[str]
|
||||
|
||||
class ClassDef(stmt):
|
||||
name = ... # type: _identifier
|
||||
@@ -51,6 +57,8 @@ class ClassDef(stmt):
|
||||
keywords = ... # type: typing.List[keyword]
|
||||
body = ... # type: typing.List[stmt]
|
||||
decorator_list = ... # type: typing.List[expr]
|
||||
if sys.version_info >= (3, 7):
|
||||
docstring: Optional[str]
|
||||
|
||||
class Return(stmt):
|
||||
value = ... # type: Optional[expr]
|
||||
|
||||
@@ -175,6 +175,9 @@ class FrameType:
|
||||
f_lineno = ... # type: int
|
||||
f_locals = ... # type: Dict[str, Any]
|
||||
f_trace = ... # type: Callable[[], None]
|
||||
if sys.version_info >= (3, 7):
|
||||
f_frace_lines: bool
|
||||
f_trace_opcodes: bool
|
||||
|
||||
def clear(self) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user