From 14d250bfbda69568230d36b4664124540bb859c0 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Wed, 27 Sep 2017 15:56:06 +0300 Subject: [PATCH] Move base types to base module. --- aiogram/types/__init__.py | 10 ---------- aiogram/types/base.py | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/aiogram/types/__init__.py b/aiogram/types/__init__.py index 5d9e5391..dc0f38a5 100644 --- a/aiogram/types/__init__.py +++ b/aiogram/types/__init__.py @@ -1,6 +1,3 @@ -import io as _io -from typing import TypeVar as _TypeVar - from . import base from . import fields @@ -8,10 +5,3 @@ __all__ = ( 'base', 'fields', '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) diff --git a/aiogram/types/base.py b/aiogram/types/base.py index fb15f25a..fd26fb0b 100644 --- a/aiogram/types/base.py +++ b/aiogram/types/base.py @@ -1,5 +1,7 @@ +import io import typing import ujson +from typing import TypeVar from .fields import BaseField @@ -9,6 +11,13 @@ ALIASES_ATTR_NAME = '_aliases' __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): """