Skip to content

Commit

Permalink
Merge pull request #215 from pallets/update-typing
Browse files Browse the repository at this point in the history
Update typing
  • Loading branch information
davidism authored May 18, 2021
2 parents 4f54e0e + 1913ee4 commit 2f4f33f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 8 additions & 7 deletions src/markupsafe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
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

Expand Down Expand Up @@ -276,12 +277,12 @@ def __float__(self) -> float:

# 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

0 comments on commit 2f4f33f

Please sign in to comment.