Move base types to base module.

This commit is contained in:
Alex Root Junior 2017-09-27 15:56:06 +03:00
parent 00cc42c216
commit 14d250bfbd
2 changed files with 9 additions and 10 deletions

View file

@ -1,6 +1,3 @@
import io as _io
from typing import TypeVar as _TypeVar
from . import base from . import base
from . import fields from . import fields
@ -8,10 +5,3 @@ __all__ = (
'base', 'fields', 'base', 'fields',
'InputFile', 'String', 'Integer', 'Float', 'Boolean' 'InputFile', 'String', 'Integer', 'Float', 'Boolean'
) )
# Binding of builtin types
InputFile = _TypeVar('InputFile', _io.BytesIO, _io.FileIO, str)
String = _TypeVar('String', bound=str)
Integer = _TypeVar('Integer', bound=int)
Float = _TypeVar('Float', bound=float)
Boolean = _TypeVar('Boolean', bound=bool)

View file

@ -1,5 +1,7 @@
import io
import typing import typing
import ujson import ujson
from typing import TypeVar
from .fields import BaseField from .fields import BaseField
@ -9,6 +11,13 @@ ALIASES_ATTR_NAME = '_aliases'
__all__ = ('MetaTelegramObject', 'TelegramObject') __all__ = ('MetaTelegramObject', 'TelegramObject')
# Binding of builtin types
InputFile = TypeVar('InputFile', io.BytesIO, io.FileIO, str)
String = TypeVar('String', bound=str)
Integer = TypeVar('Integer', bound=int)
Float = TypeVar('Float', bound=float)
Boolean = TypeVar('Boolean', bound=bool)
class MetaTelegramObject(type): class MetaTelegramObject(type):
""" """