mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-15 02:31:09 +08:00
codecs: add missing function, reflect runtime import * (#7918)
This commit is contained in:
1 parent
18433202ba
commit
9660ee97ee
5 files changed
+73
-64
No files matched your search
@@ -0,0 +1,13 @@
|
||||
# pyright: reportUnnecessaryTypeIgnoreComment=true
|
||||
|
||||
import codecs
|
||||
from typing_extensions import assert_type
|
||||
|
||||
assert_type(codecs.decode("x", "unicode-escape"), str)
|
||||
assert_type(codecs.decode(b"x", "unicode-escape"), str)
|
||||
|
||||
assert_type(codecs.decode(b"x", "utf-8"), str)
|
||||
codecs.decode("x", "utf-8") # type: ignore[call-overload]
|
||||
|
||||
assert_type(codecs.decode("ab", "hex"), bytes)
|
||||
assert_type(codecs.decode(b"ab", "hex"), bytes)
|
||||
Reference in new issue
Block a user