Skip to content

Commit

Permalink
[bleach] Add html5lib_shim.Filter__init__/__iter__ (#10835)
Browse files Browse the repository at this point in the history
The missing __init__ method caused `Filter` to be incompatible
with the `_Filter` protocol, preventing valid initialization of
`Cleaner` instances.

Closes: #10834
  • Loading branch information
srittau authored Oct 4, 2023
1 parent 25eb99c commit af8c3a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions stubs/bleach/bleach/html5lib_shim.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from _typeshed import Incomplete
from collections.abc import Generator, Iterable
from collections.abc import Generator, Iterable, Iterator

class HTMLParser: # actually html5lib.HTMLParser
def __getattr__(self, __name: str) -> Incomplete: ...

class Filter: # actually html5lib.filters.base.Filter
def __getattr__(self, __name: str) -> Incomplete: ...
source: Incomplete
def __init__(self, source) -> None: ...
def __iter__(self) -> Iterator[Incomplete]: ...
def __getattr__(self, name: str) -> Incomplete: ... # copy attributes from source

class SanitizerFilter: # actually html5lib.filters.sanitizer.Filter
def __getattr__(self, __name: str) -> Incomplete: ...
Expand Down

0 comments on commit af8c3a1

Please sign in to comment.