8000 Complete stubs for `bleach` by sobolevn · Pull Request #9314 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Complete stubs for bleach #9314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4375fb5
Mark `bleach` as complete
sobolevn Dec 1, 2022
49d8286
Fix CI
sobolevn Dec 1, 2022
b924759
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 1, 2022
146a810
Merge branch 'main' into mark-bleach
AlexWaygood Feb 19, 2023
18e31e5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 19, 2023
24e2ad3
Fix some obvious merge issues
AlexWaygood Feb 19, 2023
1b526fe
fix more mistakes when merging `main`
AlexWaygood Feb 19, 2023
198f6a6
Update linkifier.pyi
AlexWaygood Feb 19, 2023
22fd76e
Remove unused allowlist entries
AlexWaygood Feb 19, 2023
dc39112
Merge branch 'main' into mark-bleach
AlexWaygood Feb 21, 2023
3245722
Merge branch 'main' into mark-bleach
AlexWaygood Jul 22, 2023
c4767d5
Update stubs/bleach/METADATA.toml
AlexWaygood Jul 22, 2023
704cb27
Update stubs/bleach/bleach/html5lib_shim.pyi
AlexWaygood Jul 22, 2023
5950664
fix mypy
AlexWaygood Jul 22, 2023
c723045
Merge branch 'main' into mark-bleach
Avasam Nov 30, 2023
c9faed8
Post-merge remove bleach from pyrightconfig.stricter.json
Avasam Nov 30, 2023
7b72eef
Merge branch 'main' into mark-bleach
AlexWaygood Feb 5, 2024
96fc2c4
Merge branch 'main' of https://github.com/python/typeshed into mark-b…
Avasam Feb 20, 2024
c79dca1
Ran stubdefaulter
Avasam Feb 20, 2024
7723b65
Complete missing types
Avasam Feb 20, 2024
ea95d05
Address PR comments
Avasam Feb 20, 2024
a4ee82c
More PR comments
Avasam Feb 20, 2024
5a39614
Mark uppercase names as Final
Avasam Feb 20, 2024
3f865d3
Reduce allowlist entried and indicate possible runtime failure
Avasam Feb 21, 2024
5f48c83
typo
Avasam Feb 21, 2024
9c88154
Update stubs/html5lib/html5lib/_inputstream.pyi
Avasam Feb 21, 2024
e318888
Update stubs/bleach/bleach/html5lib_shim.pyi
Avasam Feb 21, 2024
c4aeaa5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More PR comments
  • Loading branch information
Avasam committed Feb 20, 2024
commit a4ee82cb58153d10458b998e9ccdd7d988761744
6 changes: 3 additions & 3 deletions stubs/bleach/bleach/html5lib_shim.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
from codecs import CodecInfo
from collections.abc import Collection, Generator, Iterable, Iterator
from typing import Any
from typing import Any, Protocol

# We don't re-export any `html5lib` types / values here, because they are not
# really public and may change at any time. This is just a helper module,
Expand All @@ -14,7 +14,7 @@ from html5lib.serializer import HTMLSerializer
from html5lib.treewalkers.base import TreeWalker

# Is actually webencodings.Encoding
class _Encoding:
class _Encoding(Protocol):
name: str
codec_info: CodecInfo
def __init__(self, name: str, codec_info: CodecInfo) -> None: ...
Expand All @@ -31,7 +31,7 @@ TAG_TOKEN_TYPE_PARSEERROR: int
TAG_TOKEN_TYPE_START: int

class InputStreamWithMemory:
position: int
position = HTMLUnicodeInputStream.position
def __init__(self, inner_stream: HTMLUnicodeInputStream) -> None: ...
def reset(self) -> None: ...
@property
Expand Down
2 changes: 1 addition & 1 deletion stubs/bleach/bleach/linkifier.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class LinkifyFilter(Filter):
url_re: Pattern[str] = ...,
email_re: Pattern[str] = ...,
) -> None: ...
def apply_callbacks(self, attrs: _HTMLAttrs, is_new: bool) -> _HTMLAttrs: ...
def apply_callbacks(self, attrs: _HTMLAttrs, is_new: bool) -> _HTMLAttrs | None: ...
def extract_character_data(self, token_list: Iterable[_Token]) -> str: ...
def handle_email_addresses(self, src_iter: Iterable[_Token]) -> Iterator[_Token]: ...
def strip_non_url_bits(self, fragment: str) -> tuple[str, str, str]: ...
Expand Down
4 changes: 2 additions & 2 deletions stubs/html5lib/html5lib/_inputstream.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from _typeshed import Incomplete, SupportsRead
from codecs import CodecInfo
from typing import Any, overload
from typing import Any, Protocol, overload
from typing_extensions import TypeAlias

# Is actually webencodings.Encoding
class _Encoding:
class _Encoding(Protocol):
name: str
codec_info: CodecInfo
def __init__(self, name: str, codec_info: CodecInfo) -> None: ...
Expand Down
0