From ec040eb51f8df7aea682b895e1cd2f1228746311 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Wed, 27 Sep 2017 09:02:09 +0300 Subject: [PATCH] Builtin types. --- aiogram/types/__init__.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/aiogram/types/__init__.py b/aiogram/types/__init__.py index 541f6ce8..5d9e5391 100644 --- a/aiogram/types/__init__.py +++ b/aiogram/types/__init__.py @@ -1,6 +1,17 @@ +import io as _io +from typing import TypeVar as _TypeVar + from . import base from . import fields __all__ = ( - 'base', 'fields' + '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)