mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
Add support for Python 3.7 (#216)
* Add support for Python 3.7 * fixup! Add support for Python 3.7 * fixup! Add support for Python 3.7 * fixup! Add support for Python 3.7
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
History
|
||||
-------
|
||||
|
||||
v0.11.1 (2018-07-01)
|
||||
....................
|
||||
* support Python 3.7
|
||||
|
||||
v0.11.0 (2018-06-28)
|
||||
....................
|
||||
* make ``list``, ``tuple`` and ``set`` types stricter #86
|
||||
|
||||
+7
-2
@@ -3,7 +3,7 @@ from contextlib import contextmanager
|
||||
from enum import Enum
|
||||
from importlib import import_module
|
||||
from textwrap import dedent
|
||||
from typing import Tuple, _TypingBase
|
||||
from typing import Tuple
|
||||
|
||||
from . import errors
|
||||
|
||||
@@ -12,6 +12,11 @@ try:
|
||||
except ImportError:
|
||||
email_validator = None
|
||||
|
||||
try:
|
||||
from typing import _TypingBase as typing_base
|
||||
except ImportError:
|
||||
from typing import _Final as typing_base
|
||||
|
||||
|
||||
PRETTY_REGEX = re.compile(r'([\w ]*?) *<(.*)> *')
|
||||
|
||||
@@ -117,7 +122,7 @@ def truncate(v, *, max_len=80):
|
||||
|
||||
|
||||
def display_as_type(v):
|
||||
if not isinstance(v, _TypingBase) and not isinstance(v, type):
|
||||
if not isinstance(v, typing_base) and not isinstance(v, type):
|
||||
v = type(v)
|
||||
|
||||
if isinstance(v, type) and issubclass(v, Enum):
|
||||
|
||||
Reference in New Issue
Block a user