Make mypy happy

This commit is contained in:
Salvo 'LtWorf' Tomaselli 2020-08-24 18:38:10 +02:00
parent 4d280e02b0
commit 0920559a82
No known key found for this signature in database
GPG Key ID: B3A7CF0C801886CF

View File

@ -23,7 +23,7 @@
import datetime import datetime
import keyword import keyword
import re import re
from typing import Union, Set, Any, Callable from typing import Union, Set, Any, Callable, Type
from dataclasses import dataclass from dataclasses import dataclass
@ -34,8 +34,8 @@ _date_regexp = re.compile(
CastValue = Union[str, int, float, 'Rdate'] CastValue = Union[str, int, float, 'Rdate']
def guess_type(value: str) -> Set[Callable[[Any], Any]]: def guess_type(value: str) -> Set[Union[Callable[[Any], Any], Type['Rdate']]]:
r: Set[Callable[[Any], Any]] = {str} r: Set[Union[Callable[[Any], Any], Type['Rdate']]] = {str}
if _date_regexp.match(value) is not None: if _date_regexp.match(value) is not None:
r.add(Rdate) r.add(Rdate)