mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 20:31:32 +08:00
Third-party stubs: enforce CamelCase for type alias names (#8256)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ from typing import Any, ClassVar
|
||||
from .. import util
|
||||
from ..util import HasMemoized, hybridmethod, memoized_property
|
||||
from . import roles
|
||||
from .elements import ColumnElement
|
||||
from .traversals import (
|
||||
HasCacheKey as HasCacheKey,
|
||||
HasCopyInternals as HasCopyInternals,
|
||||
@@ -151,7 +152,7 @@ class ImmutableColumnCollection(util.ImmutableContainer, ColumnCollection):
|
||||
extend: Any
|
||||
remove: Any
|
||||
|
||||
class ColumnSet(util.ordered_column_set):
|
||||
class ColumnSet(util.ordered_column_set[ColumnElement[Any]]):
|
||||
def contains_column(self, col): ...
|
||||
def extend(self, cols) -> None: ...
|
||||
def __add__(self, other): ...
|
||||
|
||||
@@ -2,10 +2,8 @@ import collections.abc
|
||||
from _typeshed import Self, SupportsKeysAndGetItem
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping
|
||||
from typing import Any, Generic, NoReturn, TypeVar, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from ..cimmutabledict import immutabledict as immutabledict
|
||||
from ..sql.elements import ColumnElement
|
||||
|
||||
_KT = TypeVar("_KT")
|
||||
_VT = TypeVar("_VT")
|
||||
@@ -163,7 +161,11 @@ class WeakPopulateDict(dict[Any, Any]):
|
||||
|
||||
column_set = set
|
||||
column_dict = dict
|
||||
ordered_column_set: TypeAlias = OrderedSet[ColumnElement[Any]]
|
||||
# Ignore Y026, this isn't a type alias.
|
||||
# We have to do `ordered_column_set = OrderedSet[_T]
|
||||
# instead of `ordered_column_set = OrderedSet`,
|
||||
# or pyright complains
|
||||
ordered_column_set = OrderedSet[_T] # noqa: Y026
|
||||
|
||||
def unique_list(seq: Iterable[_T], hashfunc: Callable[[_T], Any] | None = ...) -> list[_T]: ...
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@ from typing_extensions import TypeAlias
|
||||
|
||||
from .langhelpers import memoized_property
|
||||
|
||||
_greenlet: TypeAlias = Any # actually greenlet.greenlet
|
||||
_Greenlet: TypeAlias = Any # actually greenlet.greenlet
|
||||
|
||||
def is_exit_exception(e): ...
|
||||
|
||||
class _AsyncIoGreenlet(_greenlet):
|
||||
class _AsyncIoGreenlet(_Greenlet):
|
||||
driver: Any
|
||||
gr_context: Any
|
||||
def __init__(self, fn, driver) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user