Values can be None

This commit is contained in:
Salvo 'LtWorf' Tomaselli 2020-08-24 18:42:18 +02:00
parent 0920559a82
commit 177ca5a3ee
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, Type from typing import Union, Set, Any, Callable, Type, Optional
from dataclasses import dataclass from dataclasses import dataclass
@ -31,7 +31,7 @@ RELATION_NAME_REGEXP = re.compile(r'^[_a-z][_a-z0-9]*$', re.IGNORECASE)
_date_regexp = re.compile( _date_regexp = re.compile(
r'^([0-9]{1,4})(\\|-|/)([0-9]{1,2})(\\|-|/)([0-9]{1,2})$' r'^([0-9]{1,4})(\\|-|/)([0-9]{1,2})(\\|-|/)([0-9]{1,2})$'
) )
CastValue = Union[str, int, float, 'Rdate'] CastValue = Optional[Union[str, int, float, 'Rdate']]
def guess_type(value: str) -> Set[Union[Callable[[Any], Any], Type['Rdate']]]: def guess_type(value: str) -> Set[Union[Callable[[Any], Any], Type['Rdate']]]: