Skip to content

Commit 20d0b5c

Browse files
committed
Added several missing annotations to serializer.pyi
1 parent 5aea297 commit 20d0b5c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

stubs/html5lib/METADATA.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
version = "1.1.*"
22
upstream_repository = "https://github.com/html5lib/html5lib-python"
33

4+
requires = ["six"]
5+
46
[tool.stubtest]
57
extras = ["all"]

stubs/html5lib/html5lib/serializer.pyi

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from _typeshed import Incomplete
22
from collections.abc import Generator
33
from typing import overload
4+
from six import text_type
5+
46

57
k: str
68
v: str | int
@@ -32,11 +34,11 @@ class HTMLSerializer:
3234
errors: Incomplete
3335
strict: bool
3436
def __init__(self, **kwargs) -> None: ...
35-
def encode(self, string): ...
36-
def encodeStrict(self, string): ...
37+
def encode(self, string: text_type) -> str: ...
38+
def encodeStrict(self, string: text_type) -> str: ...
3739
encoding: Incomplete
38-
def serialize(self, treewalker, encoding=None) -> Generator[Incomplete]: ...
39-
def render(self, treewalker, encoding=None): ...
40+
def serialize(self, treewalker: str, encoding: str) -> str: ...
41+
def render(self, treewalker: str, encoding: str) -> str: ...
4042
def serializeError(self, data: str = "XXX ERROR MESSAGE NEEDED") -> None: ...
4143

4244
class SerializeError(Exception): ...

0 commit comments

Comments
 (0)