future first: switch the order of some if statements (#5206)

Since we're adding this to our contribution guidelines in
https://github.com/python/typeshed/pull/5205
This commit is contained in:
Shantanu
2021-04-11 06:44:18 -07:00
committed by GitHub
parent b308c1f964
commit fa9d5a5e9f
36 changed files with 147 additions and 146 deletions

View File

@@ -4,10 +4,10 @@ from typing import List, Optional, Type, TypeVar, overload
from .handlers import SimpleHandler
from .types import ErrorStream, StartResponse, WSGIApplication, WSGIEnvironment
if sys.version_info < (3,):
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
else:
if sys.version_info >= (3, 0):
from http.server import BaseHTTPRequestHandler, HTTPServer
else:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
server_version: str # undocumented
sys_version: str # undocumented

View File

@@ -10,10 +10,10 @@ class FileWrapper:
def __init__(self, filelike: IO[bytes], blksize: int = ...) -> None: ...
def __getitem__(self, key: Any) -> bytes: ...
def __iter__(self) -> FileWrapper: ...
if sys.version_info < (3,):
def next(self) -> bytes: ...
else:
if sys.version_info >= (3, 0):
def __next__(self) -> bytes: ...
else:
def next(self) -> bytes: ...
def guess_scheme(environ: WSGIEnvironment) -> str: ...
def application_uri(environ: WSGIEnvironment) -> str: ...

View File

@@ -9,12 +9,12 @@ def validator(application: WSGIApplication) -> WSGIApplication: ...
class InputWrapper:
input: InputStream
def __init__(self, wsgi_input: InputStream) -> None: ...
if sys.version_info < (3,):
def read(self, size: int = ...) -> bytes: ...
def readline(self) -> bytes: ...
else:
if sys.version_info >= (3, 0):
def read(self, size: int) -> bytes: ...
def readline(self, size: int = ...) -> bytes: ...
else:
def read(self, size: int = ...) -> bytes: ...
def readline(self) -> bytes: ...
def readlines(self, hint: int = ...) -> bytes: ...
def __iter__(self) -> Iterable[bytes]: ...
def close(self) -> NoReturn: ...
@@ -44,9 +44,9 @@ class IteratorWrapper:
check_start_response: Optional[bool]
def __init__(self, wsgi_iterator: Iterator[bytes], check_start_response: Optional[bool]) -> None: ...
def __iter__(self) -> IteratorWrapper: ...
if sys.version_info < (3,):
def next(self) -> bytes: ...
else:
if sys.version_info >= (3, 0):
def __next__(self) -> bytes: ...
else:
def next(self) -> bytes: ...
def close(self) -> None: ...
def __del__(self) -> None: ...