Use Final for xml constants (#12455)

This commit is contained in:
Max Muoto
2024-08-05 04:13:56 -05:00
committed by GitHub
parent cfb33ac1bd
commit 7eac47455a
3 changed files with 29 additions and 28 deletions

View File

@@ -1,14 +1,15 @@
import sys
from _typeshed import FileDescriptorOrPath
from collections.abc import Callable
from typing import Final
from xml.etree.ElementTree import Element
XINCLUDE: str
XINCLUDE_INCLUDE: str
XINCLUDE_FALLBACK: str
XINCLUDE: Final[str]
XINCLUDE_INCLUDE: Final[str]
XINCLUDE_FALLBACK: Final[str]
if sys.version_info >= (3, 9):
DEFAULT_MAX_INCLUSION_DEPTH: int
DEFAULT_MAX_INCLUSION_DEPTH: Final = 6
class FatalIncludeError(SyntaxError): ...

View File

@@ -2,7 +2,7 @@ import sys
from _collections_abc import dict_keys
from _typeshed import FileDescriptorOrPath, ReadableBuffer, SupportsRead, SupportsWrite
from collections.abc import Callable, Generator, ItemsView, Iterable, Iterator, Mapping, Sequence
from typing import Any, Literal, SupportsIndex, TypeVar, overload
from typing import Any, Final, Literal, SupportsIndex, TypeVar, overload
from typing_extensions import TypeAlias, TypeGuard, deprecated
__all__ = [
@@ -41,7 +41,7 @@ _FileRead: TypeAlias = FileDescriptorOrPath | SupportsRead[bytes] | SupportsRead
_FileWriteC14N: TypeAlias = FileDescriptorOrPath | SupportsWrite[bytes]
_FileWrite: TypeAlias = _FileWriteC14N | SupportsWrite[str]
VERSION: str
VERSION: Final[str]
class ParseError(SyntaxError):
code: int