diff options
author | David Lord <davidism@gmail.com> | 2021-05-18 08:46:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-18 08:46:57 -0700 |
commit | 2f4f33f78052c1c508005dcf4e7e813d2e199339 (patch) | |
tree | faf698ef11ce2099b9965d413cd2cea8ae0d0457 | |
parent | 4f54e0ea0670309e88ce717c0e4a6794f9bd7b3b (diff) | |
parent | 1913ee4aa6be6dce7b47d65d8c0c098e8a4c7bd0 (diff) | |
download | markupsafe-2f4f33f78052c1c508005dcf4e7e813d2e199339.tar.gz |
Merge pull request #215 from pallets/update-typing
Update typing
-rw-r--r-- | CHANGES.rst | 4 | ||||
-rw-r--r-- | setup.cfg | 2 | ||||
-rw-r--r-- | src/markupsafe/__init__.py | 15 |
3 files changed, 13 insertions, 8 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index 28c009d..55153c5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,6 +3,10 @@ Version 2.0.1 Unreleased +- Mark top-level names as exported so type checking understands + imports in user projects. :pr:`215` +- Fix some types that weren't available in Python 3.6.0. :pr:`215` + Version 2.0.0 ------------- @@ -82,7 +82,7 @@ disallow_untyped_defs = True disallow_incomplete_defs = True no_implicit_optional = True local_partial_types = True -# no_implicit_reexport = True +no_implicit_reexport = True strict_equality = True warn_redundant_casts = True warn_unused_configs = True diff --git a/src/markupsafe/__init__.py b/src/markupsafe/__init__.py index a5135a4..7e2e721 100644 --- a/src/markupsafe/__init__.py +++ b/src/markupsafe/__init__.py @@ -4,8 +4,9 @@ import string import typing as t if t.TYPE_CHECKING: + import typing_extensions as te - class HasHTML(t.Protocol): + class HasHTML(te.Protocol): def __html__(self) -> str: pass @@ -276,12 +277,12 @@ class _MarkupEscapeHelper: # circular import try: - from ._speedups import escape - from ._speedups import escape_silent - from ._speedups import soft_str + from ._speedups import escape as escape + from ._speedups import escape_silent as escape_silent + from ._speedups import soft_str as soft_str from ._speedups import soft_unicode except ImportError: - from ._native import escape - from ._native import escape_silent # noqa: F401 - from ._native import soft_str # noqa: F401 + from ._native import escape as escape + from ._native import escape_silent as escape_silent # noqa: F401 + from ._native import soft_str as soft_str # noqa: F401 from ._native import soft_unicode # noqa: F401 |