mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-24 09:18:40 +08:00
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:
@@ -32,14 +32,14 @@ from .datastructures import (
|
||||
WWWAuthenticate,
|
||||
)
|
||||
|
||||
if sys.version_info < (3,):
|
||||
_Str = TypeVar("_Str", str, unicode)
|
||||
_ToBytes = Union[bytes, bytearray, buffer, unicode]
|
||||
_ETagData = Union[str, unicode, bytearray, buffer, memoryview]
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
_Str = str
|
||||
_ToBytes = Union[bytes, bytearray, memoryview, str]
|
||||
_ETagData = Union[bytes, bytearray, memoryview]
|
||||
else:
|
||||
_Str = TypeVar("_Str", str, unicode)
|
||||
_ToBytes = Union[bytes, bytearray, buffer, unicode]
|
||||
_ETagData = Union[str, unicode, bytearray, buffer, memoryview]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_U = TypeVar("_U")
|
||||
|
||||
@@ -45,10 +45,10 @@ class GuardedIterator(object):
|
||||
chunks: List[int]
|
||||
def __init__(self, iterator: Iterable[str], headers_set: bool, chunks: List[int]) -> None: ...
|
||||
def __iter__(self) -> GuardedIterator: ...
|
||||
if sys.version_info < (3,):
|
||||
def next(self) -> str: ...
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
def __next__(self) -> str: ...
|
||||
else:
|
||||
def next(self) -> str: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
class LintMiddleware(object):
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import sys
|
||||
from typing import Any, Optional
|
||||
|
||||
if sys.version_info < (3,):
|
||||
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
|
||||
from SocketServer import ThreadingMixIn
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||
from socketserver import ThreadingMixIn
|
||||
else:
|
||||
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
|
||||
from SocketServer import ThreadingMixIn
|
||||
|
||||
if sys.platform == "win32":
|
||||
class ForkingMixIn(object): ...
|
||||
|
||||
else:
|
||||
if sys.version_info < (3,):
|
||||
from SocketServer import ForkingMixIn as ForkingMixIn
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
from socketserver import ForkingMixIn as ForkingMixIn
|
||||
else:
|
||||
from SocketServer import ForkingMixIn as ForkingMixIn
|
||||
|
||||
class _SslDummy:
|
||||
def __getattr__(self, name): ...
|
||||
|
||||
@@ -3,12 +3,12 @@ from _typeshed.wsgi import WSGIEnvironment
|
||||
from typing import Any, Generic, Optional, Text, Tuple, Type, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info < (3,):
|
||||
from cookielib import CookieJar
|
||||
from urllib2 import Request as U2Request
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
from http.cookiejar import CookieJar
|
||||
from urllib.request import Request as U2Request
|
||||
else:
|
||||
from cookielib import CookieJar
|
||||
from urllib2 import Request as U2Request
|
||||
|
||||
def stream_encode_multipart(
|
||||
values, use_tempfile: int = ..., threshold=..., boundary: Optional[Any] = ..., charset: Text = ...
|
||||
|
||||
Reference in New Issue
Block a user