summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lord <davidism@gmail.com>2021-05-10 19:23:41 -0700
committerGitHub <noreply@github.com>2021-05-10 19:23:41 -0700
commit0bd14f07a9739b21ac4632e021b07dedad352c94 (patch)
tree3effcdb248d14cc1f2202a6dad487a6873a0b91a
parent88173cb78e0781850c9a2c298b96744b1678399f (diff)
parent15ffa634d0ae52529a8f880a8ff882e06fdf6b44 (diff)
downloadmarkupsafe-0bd14f07a9739b21ac4632e021b07dedad352c94.tar.gz
Merge pull request #209 from pallets/formatter-super
call string.Formatter.__init__
-rw-r--r--src/markupsafe/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/markupsafe/__init__.py b/src/markupsafe/__init__.py
index d4c3c7d..0f1c71a 100644
--- a/src/markupsafe/__init__.py
+++ b/src/markupsafe/__init__.py
@@ -211,8 +211,11 @@ class Markup(str):
class EscapeFormatter(string.Formatter):
+ __slots__ = ("escape",)
+
def __init__(self, escape: t.Callable[[t.Any], Markup]) -> None:
self.escape = escape
+ super().__init__()
def format_field(self, value: t.Any, format_spec: str) -> str:
if hasattr(value, "__html_format__"):
@@ -249,6 +252,8 @@ def _escape_argspec(
class _MarkupEscapeHelper:
"""Helper for :meth:`Markup.__mod__`."""
+ __slots__ = ("obj", "escape")
+
def __init__(self, obj: t.Any, escape: t.Callable[[t.Any], Markup]) -> None:
self.obj = obj
self.escape = escape