mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-10 17:07:29 +08:00
Add back module-level __getattr__ to encodings (#5261)
This is needed for submodules, such as `encodings.cp437`.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
],
|
||||
"exclude": [
|
||||
"**/@python2",
|
||||
"stdlib/encodings",
|
||||
"stdlib/sqlite3/dbapi2.pyi",
|
||||
"stdlib/tkinter",
|
||||
"stdlib/xml/dom",
|
||||
@@ -83,4 +84,4 @@
|
||||
// Mypy's overlapping overload logic misses these issues (see mypy
|
||||
// issue #10143 and #10157).
|
||||
"reportOverlappingOverload": "none"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
from codecs import CodecInfo
|
||||
from typing import Optional, Union
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
class CodecRegistryError(LookupError, SystemError): ...
|
||||
|
||||
def normalize_encoding(encoding: Union[str, bytes]) -> str: ...
|
||||
def search_function(encoding: str) -> Optional[CodecInfo]: ...
|
||||
|
||||
# Needed for submodules
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
|
||||
Reference in New Issue
Block a user