File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,12 @@ def __init__(self, **kwargs):
113
113
]
114
114
""" List of characters which get the backslash escape treatment. """
115
115
116
+
117
+ # `BLOCK_LEVEL_ELEMENTS` is actually a hybrid list/set container.
118
+ # It supports list methods for backwards compatibility.
119
+ # We expliclitly lie here, so that users running type checkers will get
120
+ # warnings when they use the container as a list. This is a very effective
121
+ # way of communicating the change, and deprecating list-like usage.
116
122
self .block_level_elements : set [str ] = BLOCK_LEVEL_ELEMENTS .copy ()
117
123
118
124
self .registeredExtensions : list [Extension ] = []
Original file line number Diff line number Diff line change @@ -312,6 +312,9 @@ def update(self, *others: set[str]) -> None:
312
312
313
313
314
314
# Type it as `set[str]` to express our intent for it to be used as such.
315
+ # We expliclitly lie here, so that users running type checkers will get
316
+ # warnings when they use the container as a list. This is a very effective
317
+ # way of communicating the change, and deprecating list-like usage.
315
318
BLOCK_LEVEL_ELEMENTS : set [str ] = _BlockLevelElements ([
316
319
# Elements which are invalid to wrap in a `<p>` tag.
317
320
# See https://w3c.github.io/html/grouping-content.html#the-p-element
You can’t perform that action at this time.
0 commit comments