Replace some type with Type[] (#5254)

* Replace some type with Type[]

* Change aggregate_class to be Callable
This commit is contained in:
hatal175 authored and GitHub committed 2021-04-26 07:31:16 -07:00
1 parent e5336e2358
commit a98e3e3ff9
2 files changed
+7 -3

No files matched your search

+6 -2
View File
@@ -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: ...