mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Replace some type with Type[] (#5254)
* Replace some type with Type[] * Change aggregate_class to be Callable
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import sys
|
||||
from datetime import date, datetime, time
|
||||
from typing import Any, Callable, Generator, Iterable, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union
|
||||
from typing import Any, Callable, Generator, Iterable, Iterator, List, Optional, Protocol, Text, Tuple, Type, TypeVar, Union
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -113,6 +113,10 @@ if sys.version_info < (3, 8):
|
||||
def display(self, *args, **kwargs) -> None: ...
|
||||
def get(self, *args, **kwargs) -> None: ...
|
||||
|
||||
class _AggregateProtocol(Protocol):
|
||||
def step(self, value: int) -> None: ...
|
||||
def finalize(self) -> int: ...
|
||||
|
||||
class Connection(object):
|
||||
DataError: Any
|
||||
DatabaseError: Any
|
||||
@@ -132,7 +136,7 @@ class Connection(object):
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def commit(self) -> None: ...
|
||||
def create_aggregate(self, name: str, num_params: int, aggregate_class: type) -> None: ...
|
||||
def create_aggregate(self, name: str, num_params: int, aggregate_class: Callable[[], _AggregateProtocol]) -> None: ...
|
||||
def create_collation(self, name: str, callable: Any) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def create_function(self, name: str, num_params: int, func: Any, *, deterministic: bool = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user