Refactor examples/i18n_example.py

This commit is contained in:
Suren Khorenyan 2019-08-10 17:55:39 +03:00
parent d360538bba
commit a78b93c5cd
5 changed files with 37 additions and 23 deletions

View file

@ -1,5 +1,7 @@
from __future__ import annotations
from typing import Optional
import babel
from . import base
@ -45,7 +47,7 @@ class User(base.TelegramObject):
return self.full_name
@property
def locale(self) -> babel.core.Locale or None:
def locale(self) -> Optional[babel.core.Locale]:
"""
Get user's locale