Skip to content

Commit

Permalink
remove "= ..." from top-level values
Browse files Browse the repository at this point in the history
Unblocks turning on Y092; see PyCQA/flake8-pyi#86
  • Loading branch information
JelleZijlstra committed Jan 16, 2022
1 parent dbcb38a commit 54fa237
Show file tree
Hide file tree
Showing 13 changed files with 166 additions and 167 deletions.
2 changes: 1 addition & 1 deletion stdlib/@python2/asyncore.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ from typing import Any, Dict, Optional, Tuple, overload
# cyclic dependence with asynchat
_maptype = Dict[int, Any]

socket_map: _maptype = ... # undocumented
socket_map: _maptype # undocumented

class ExitNow(Exception): ...

Expand Down
2 changes: 1 addition & 1 deletion stdlib/@python2/bdb.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _T = TypeVar("_T")
_TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type
_ExcInfo = Tuple[Type[BaseException], BaseException, FrameType]

GENERATOR_AND_COROUTINE_FLAGS: int = ...
GENERATOR_AND_COROUTINE_FLAGS: int

class BdbQuit(Exception): ...

Expand Down
16 changes: 8 additions & 8 deletions stdlib/@python2/ctypes/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ _T = TypeVar("_T")
_DLLT = TypeVar("_DLLT", bound=CDLL)
_CT = TypeVar("_CT", bound=_CData)

RTLD_GLOBAL: int = ...
RTLD_LOCAL: int = ...
DEFAULT_MODE: int = ...
RTLD_GLOBAL: int
RTLD_LOCAL: int
DEFAULT_MODE: int

class CDLL(object):
_func_flags_: ClassVar[int] = ...
Expand All @@ -51,12 +51,12 @@ class LibraryLoader(Generic[_DLLT]):
def __getitem__(self, name: str) -> _DLLT: ...
def LoadLibrary(self, name: str) -> _DLLT: ...

cdll: LibraryLoader[CDLL] = ...
cdll: LibraryLoader[CDLL]
if sys.platform == "win32":
windll: LibraryLoader[WinDLL] = ...
oledll: LibraryLoader[OleDLL] = ...
pydll: LibraryLoader[PyDLL] = ...
pythonapi: PyDLL = ...
windll: LibraryLoader[WinDLL]
oledll: LibraryLoader[OleDLL]
pydll: LibraryLoader[PyDLL]
pythonapi: PyDLL

# Anything that implements the read-write buffer interface.
# The buffer interface is defined purely on the C level, so we cannot define a normal Protocol
Expand Down
2 changes: 1 addition & 1 deletion stdlib/@python2/dbm/ndbm.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _ValueType = Union[str, bytes]

class error(OSError): ...

library: str = ...
library: str

# Actual typename dbm, not exposed by the implementation
class _dbm:
Expand Down
92 changes: 46 additions & 46 deletions stdlib/@python2/signal.pyi
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
from types import FrameType
from typing import Callable, Tuple, Union

SIG_DFL: int = ...
SIG_IGN: int = ...
SIG_DFL: int
SIG_IGN: int

ITIMER_REAL: int = ...
ITIMER_VIRTUAL: int = ...
ITIMER_PROF: int = ...
ITIMER_REAL: int
ITIMER_VIRTUAL: int
ITIMER_PROF: int

NSIG: int = ...
NSIG: int

SIGABRT: int = ...
SIGALRM: int = ...
SIGBREAK: int = ... # Windows
SIGBUS: int = ...
SIGCHLD: int = ...
SIGCLD: int = ...
SIGCONT: int = ...
SIGEMT: int = ...
SIGFPE: int = ...
SIGHUP: int = ...
SIGILL: int = ...
SIGINFO: int = ...
SIGINT: int = ...
SIGIO: int = ...
SIGIOT: int = ...
SIGKILL: int = ...
SIGPIPE: int = ...
SIGPOLL: int = ...
SIGPROF: int = ...
SIGPWR: int = ...
SIGQUIT: int = ...
SIGRTMAX: int = ...
SIGRTMIN: int = ...
SIGSEGV: int = ...
SIGSTOP: int = ...
SIGSYS: int = ...
SIGTERM: int = ...
SIGTRAP: int = ...
SIGTSTP: int = ...
SIGTTIN: int = ...
SIGTTOU: int = ...
SIGURG: int = ...
SIGUSR1: int = ...
SIGUSR2: int = ...
SIGVTALRM: int = ...
SIGWINCH: int = ...
SIGXCPU: int = ...
SIGXFSZ: int = ...
SIGABRT: int
SIGALRM: int
SIGBREAK: int # Windows
SIGBUS: int
SIGCHLD: int
SIGCLD: int
SIGCONT: int
SIGEMT: int
SIGFPE: int
SIGHUP: int
SIGILL: int
SIGINFO: int
SIGINT: int
SIGIO: int
SIGIOT: int
SIGKILL: int
SIGPIPE: int
SIGPOLL: int
SIGPROF: int
SIGPWR: int
SIGQUIT: int
SIGRTMAX: int
SIGRTMIN: int
SIGSEGV: int
SIGSTOP: int
SIGSYS: int
SIGTERM: int
SIGTRAP: int
SIGTSTP: int
SIGTTIN: int
SIGTTOU: int
SIGURG: int
SIGUSR1: int
SIGUSR2: int
SIGVTALRM: int
SIGWINCH: int
SIGXCPU: int
SIGXFSZ: int

# Windows
CTRL_C_EVENT: int = ...
CTRL_BREAK_EVENT: int = ...
CTRL_C_EVENT: int
CTRL_BREAK_EVENT: int

class ItimerError(IOError): ...

Expand Down
22 changes: 11 additions & 11 deletions stdlib/@python2/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ _promote = object()
class _SpecialForm(object):
def __getitem__(self, typeargs: Any) -> object: ...

Union: _SpecialForm = ...
Optional: _SpecialForm = ...
Tuple: _SpecialForm = ...
Generic: _SpecialForm = ...
Protocol: _SpecialForm = ...
Callable: _SpecialForm = ...
Type: _SpecialForm = ...
ClassVar: _SpecialForm = ...
Final: _SpecialForm = ...
Union: _SpecialForm
Optional: _SpecialForm
Tuple: _SpecialForm
Generic: _SpecialForm
Protocol: _SpecialForm
Callable: _SpecialForm
Type: _SpecialForm
ClassVar: _SpecialForm
Final: _SpecialForm
_F = TypeVar("_F", bound=Callable[..., Any])

def final(f: _F) -> _F: ...
def overload(f: _F) -> _F: ...

Literal: _SpecialForm = ...
Literal: _SpecialForm
# TypedDict is a (non-subscriptable) special form.
TypedDict: object = ...
TypedDict: object

class GenericMeta(type): ...

Expand Down
18 changes: 9 additions & 9 deletions stdlib/@python2/typing_extensions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ def runtime_checkable(cls: _TC) -> _TC: ...

# This alias for above is kept here for backwards compatibility.
runtime = runtime_checkable
Protocol: _SpecialForm = ...
Final: _SpecialForm = ...
Protocol: _SpecialForm
Final: _SpecialForm

def final(f: _F) -> _F: ...

Literal: _SpecialForm = ...
Literal: _SpecialForm

def IntVar(name: str) -> Any: ... # returns a new TypeVar

Expand All @@ -59,7 +59,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta):
def __delitem__(self, k: NoReturn) -> None: ...

# TypedDict is a (non-subscriptable) special form.
TypedDict: object = ...
TypedDict: object

OrderedDict = _Alias()

Expand All @@ -70,8 +70,8 @@ def get_type_hints(
include_extras: bool = ...,
) -> Dict[str, Any]: ...

Annotated: _SpecialForm = ...
_AnnotatedAlias: Any = ... # undocumented
Annotated: _SpecialForm
_AnnotatedAlias: Any # undocumented

@runtime_checkable
class SupportsIndex(Protocol, metaclass=abc.ABCMeta):
Expand Down Expand Up @@ -100,6 +100,6 @@ class ParamSpec:
@property
def kwargs(self) -> ParamSpecKwargs: ...

Concatenate: _SpecialForm = ...
TypeAlias: _SpecialForm = ...
TypeGuard: _SpecialForm = ...
Concatenate: _SpecialForm
TypeAlias: _SpecialForm
TypeGuard: _SpecialForm
30 changes: 15 additions & 15 deletions stdlib/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ _T = TypeVar("_T")

def overload(func: _F) -> _F: ...

Union: _SpecialForm = ...
Optional: _SpecialForm = ...
Tuple: _SpecialForm = ...
Generic: _SpecialForm = ...
Union: _SpecialForm
Optional: _SpecialForm
Tuple: _SpecialForm
Generic: _SpecialForm
# Protocol is only present in 3.8 and later, but mypy needs it unconditionally
Protocol: _SpecialForm = ...
Callable: _SpecialForm = ...
Type: _SpecialForm = ...
ClassVar: _SpecialForm = ...
NoReturn: _SpecialForm = ...
Protocol: _SpecialForm
Callable: _SpecialForm
Type: _SpecialForm
ClassVar: _SpecialForm
NoReturn: _SpecialForm
if sys.version_info >= (3, 8):
Final: _SpecialForm = ...
Final: _SpecialForm
def final(f: _T) -> _T: ...
Literal: _SpecialForm = ...
Literal: _SpecialForm
# TypedDict is a (non-subscriptable) special form.
TypedDict: object

Expand Down Expand Up @@ -87,9 +87,9 @@ if sys.version_info >= (3, 10):
def kwargs(self) -> ParamSpecKwargs: ...
def __or__(self, other: Any) -> _SpecialForm: ...
def __ror__(self, other: Any) -> _SpecialForm: ...
Concatenate: _SpecialForm = ...
TypeAlias: _SpecialForm = ...
TypeGuard: _SpecialForm = ...
Concatenate: _SpecialForm
TypeAlias: _SpecialForm
TypeGuard: _SpecialForm
class NewType:
def __init__(self, name: str, tp: type) -> None: ...
def __call__(self, x: _T) -> _T: ...
Expand Down Expand Up @@ -133,7 +133,7 @@ if sys.version_info >= (3, 7):
OrderedDict = _Alias()

if sys.version_info >= (3, 9):
Annotated: _SpecialForm = ...
Annotated: _SpecialForm

# Predefined type variables.
AnyStr = TypeVar("AnyStr", str, bytes) # noqa: Y001
Expand Down
24 changes: 12 additions & 12 deletions stdlib/typing_extensions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ def runtime_checkable(cls: _TC) -> _TC: ...

# This alias for above is kept here for backwards compatibility.
runtime = runtime_checkable
Protocol: _SpecialForm = ...
Final: _SpecialForm = ...
Self: _SpecialForm = ...
Required: _SpecialForm = ...
NotRequired: _SpecialForm = ...
Protocol: _SpecialForm
Final: _SpecialForm
Self: _SpecialForm
Required: _SpecialForm
NotRequired: _SpecialForm

def final(f: _F) -> _F: ...

Literal: _SpecialForm = ...
Literal: _SpecialForm

def IntVar(name: str) -> Any: ... # returns a new TypeVar

Expand All @@ -75,7 +75,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta):
def __delitem__(self, k: NoReturn) -> None: ...

# TypedDict is a (non-subscriptable) special form.
TypedDict: object = ...
TypedDict: object

OrderedDict = _Alias()

Expand All @@ -89,8 +89,8 @@ if sys.version_info >= (3, 7):
def get_args(tp: Any) -> tuple[Any, ...]: ...
def get_origin(tp: Any) -> Any | None: ...

Annotated: _SpecialForm = ...
_AnnotatedAlias: Any = ... # undocumented
Annotated: _SpecialForm
_AnnotatedAlias: Any # undocumented

@runtime_checkable
class SupportsIndex(Protocol, metaclass=abc.ABCMeta):
Expand Down Expand Up @@ -125,7 +125,7 @@ else:
def args(self) -> ParamSpecArgs: ...
@property
def kwargs(self) -> ParamSpecKwargs: ...
Concatenate: _SpecialForm = ...
TypeAlias: _SpecialForm = ...
TypeGuard: _SpecialForm = ...
Concatenate: _SpecialForm
TypeAlias: _SpecialForm
TypeGuard: _SpecialForm
def is_typeddict(tp: object) -> bool: ...
5 changes: 2 additions & 3 deletions stubs/cryptography/cryptography/x509/oid.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,5 @@ class CertificatePoliciesOID:
CPS_USER_NOTICE: ObjectIdentifier = ...
ANY_POLICY: ObjectIdentifier = ...

_OID_NAMES: dict[ObjectIdentifier, str] = ...

_SIG_OIDS_TO_HASH: dict[ObjectIdentifier, HashAlgorithm | None] = ...
_OID_NAMES: dict[ObjectIdentifier, str]
_SIG_OIDS_TO_HASH: dict[ObjectIdentifier, HashAlgorithm | None]
2 changes: 1 addition & 1 deletion stubs/paramiko/paramiko/pkey.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from typing import IO, Pattern

from paramiko.message import Message

OPENSSH_AUTH_MAGIC: bytes = ...
OPENSSH_AUTH_MAGIC: bytes

def _unpad_openssh(data: bytes) -> bytes: ...

Expand Down
Loading

0 comments on commit 54fa237

Please sign in to comment.