basedpyright 1.18.3 → 1.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/README.md +3 -3
  2. package/dist/pyright-langserver.js +1 -1
  3. package/dist/pyright-langserver.js.map +1 -1
  4. package/dist/pyright.js +1 -1
  5. package/dist/pyright.js.map +1 -1
  6. package/dist/typeshed-fallback/commit.txt +1 -1
  7. package/dist/typeshed-fallback/stdlib/VERSIONS +2 -0
  8. package/dist/typeshed-fallback/stdlib/_ast.pyi +140 -1667
  9. package/dist/typeshed-fallback/stdlib/_csv.pyi +14 -3
  10. package/dist/typeshed-fallback/stdlib/_curses.pyi +857 -65
  11. package/dist/typeshed-fallback/stdlib/_decimal.pyi +29 -820
  12. package/dist/typeshed-fallback/stdlib/_socket.pyi +4 -12
  13. package/dist/typeshed-fallback/stdlib/_sqlite3.pyi +387 -0
  14. package/dist/typeshed-fallback/stdlib/_ssl.pyi +406 -0
  15. package/dist/typeshed-fallback/stdlib/_weakref.pyi +2 -41
  16. package/dist/typeshed-fallback/stdlib/ast.pyi +1843 -172
  17. package/dist/typeshed-fallback/stdlib/builtins.pyi +5 -0
  18. package/dist/typeshed-fallback/stdlib/cProfile.pyi +3 -3
  19. package/dist/typeshed-fallback/stdlib/calendar.pyi +3 -3
  20. package/dist/typeshed-fallback/stdlib/concurrent/futures/process.pyi +3 -2
  21. package/dist/typeshed-fallback/stdlib/contextlib.pyi +6 -8
  22. package/dist/typeshed-fallback/stdlib/csv.pyi +4 -3
  23. package/dist/typeshed-fallback/stdlib/curses/__init__.pyi +7 -2
  24. package/dist/typeshed-fallback/stdlib/curses/panel.pyi +4 -4
  25. package/dist/typeshed-fallback/stdlib/curses/textpad.pyi +3 -3
  26. package/dist/typeshed-fallback/stdlib/decimal.pyi +840 -2
  27. package/dist/typeshed-fallback/stdlib/email/_policybase.pyi +27 -18
  28. package/dist/typeshed-fallback/stdlib/email/feedparser.pyi +5 -5
  29. package/dist/typeshed-fallback/stdlib/email/generator.pyi +46 -9
  30. package/dist/typeshed-fallback/stdlib/email/message.pyi +8 -6
  31. package/dist/typeshed-fallback/stdlib/email/parser.pyi +6 -4
  32. package/dist/typeshed-fallback/stdlib/email/policy.pyi +28 -10
  33. package/dist/typeshed-fallback/stdlib/http/client.pyi +3 -2
  34. package/dist/typeshed-fallback/stdlib/io.pyi +6 -22
  35. package/dist/typeshed-fallback/stdlib/multiprocessing/connection.pyi +27 -19
  36. package/dist/typeshed-fallback/stdlib/multiprocessing/context.pyi +5 -2
  37. package/dist/typeshed-fallback/stdlib/multiprocessing/managers.pyi +4 -2
  38. package/dist/typeshed-fallback/stdlib/multiprocessing/reduction.pyi +2 -2
  39. package/dist/typeshed-fallback/stdlib/profile.pyi +3 -3
  40. package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +1 -5
  41. package/dist/typeshed-fallback/stdlib/re.pyi +10 -1
  42. package/dist/typeshed-fallback/stdlib/socket.pyi +12 -4
  43. package/dist/typeshed-fallback/stdlib/sqlite3/__init__.pyi +739 -1
  44. package/dist/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi +220 -884
  45. package/dist/typeshed-fallback/stdlib/sre_constants.pyi +1 -8
  46. package/dist/typeshed-fallback/stdlib/ssl.pyi +40 -128
  47. package/dist/typeshed-fallback/stdlib/tarfile.pyi +111 -6
  48. package/dist/typeshed-fallback/stdlib/tkinter/__init__.pyi +127 -21
  49. package/dist/typeshed-fallback/stdlib/tokenize.pyi +1 -1
  50. package/dist/typeshed-fallback/stdlib/typing.pyi +7 -7
  51. package/dist/typeshed-fallback/stdlib/typing_extensions.pyi +1 -1
  52. package/dist/typeshed-fallback/stdlib/unittest/mock.pyi +2 -2
  53. package/dist/typeshed-fallback/stdlib/weakref.pyi +49 -14
  54. package/dist/typeshed-fallback/stdlib/xml/parsers/expat/__init__.pyi +6 -0
  55. package/dist/typeshed-fallback/stdlib/xmlrpc/client.pyi +1 -1
  56. package/dist/typeshed-fallback/stdlib/xmlrpc/server.pyi +3 -2
  57. package/dist/typeshed-fallback/stdlib/zoneinfo/__init__.pyi +41 -44
  58. package/dist/typeshed-fallback/stdlib/zoneinfo/_common.pyi +13 -0
  59. package/dist/typeshed-fallback/stdlib/zoneinfo/_tzpath.pyi +13 -0
  60. package/dist/typeshed-fallback/stubs/Flask-SocketIO/METADATA.toml +1 -1
  61. package/dist/typeshed-fallback/stubs/braintree/METADATA.toml +1 -1
  62. package/dist/typeshed-fallback/stubs/braintree/braintree/error_codes.pyi +1 -0
  63. package/dist/typeshed-fallback/stubs/docutils/docutils/__init__.pyi +3 -1
  64. package/dist/typeshed-fallback/stubs/docutils/docutils/frontend.pyi +1 -2
  65. package/dist/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/admonitions.pyi +15 -2
  66. package/dist/typeshed-fallback/stubs/docutils/docutils/readers/doctree.pyi +1 -1
  67. package/dist/typeshed-fallback/stubs/docutils/docutils/writers/__init__.pyi +21 -2
  68. package/dist/typeshed-fallback/stubs/fpdf2/fpdf/fpdf.pyi +4 -4
  69. package/dist/typeshed-fallback/stubs/greenlet/METADATA.toml +1 -1
  70. package/dist/typeshed-fallback/stubs/hdbcli/METADATA.toml +1 -1
  71. package/dist/typeshed-fallback/stubs/icalendar/METADATA.toml +5 -2
  72. package/dist/typeshed-fallback/stubs/icalendar/icalendar/__init__.pyi +49 -5
  73. package/dist/typeshed-fallback/stubs/icalendar/icalendar/cal.pyi +32 -6
  74. package/dist/typeshed-fallback/stubs/icalendar/icalendar/caselessdict.pyi +2 -0
  75. package/dist/typeshed-fallback/stubs/icalendar/icalendar/parser.pyi +25 -1
  76. package/dist/typeshed-fallback/stubs/icalendar/icalendar/parser_tools.pyi +7 -3
  77. package/dist/typeshed-fallback/stubs/icalendar/icalendar/prop.pyi +112 -72
  78. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/__init__.pyi +8 -0
  79. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/provider.pyi +29 -0
  80. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/pytz.pyi +22 -0
  81. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/tzp.pyi +30 -0
  82. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/zoneinfo.pyi +33 -0
  83. package/dist/typeshed-fallback/stubs/icalendar/icalendar/tools.pyi +2 -0
  84. package/dist/typeshed-fallback/stubs/icalendar/icalendar/version.pyi +8 -0
  85. package/dist/typeshed-fallback/stubs/jwcrypto/METADATA.toml +3 -0
  86. package/dist/typeshed-fallback/stubs/jwcrypto/jwcrypto/common.pyi +48 -0
  87. package/dist/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwa.pyi +35 -0
  88. package/dist/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwe.pyi +51 -0
  89. package/dist/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwk.pyi +115 -0
  90. package/dist/typeshed-fallback/stubs/jwcrypto/jwcrypto/jws.pyi +52 -0
  91. package/dist/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwt.pyi +78 -0
  92. package/dist/typeshed-fallback/stubs/m3u8/METADATA.toml +2 -0
  93. package/dist/typeshed-fallback/stubs/m3u8/m3u8/__init__.pyi +74 -0
  94. package/dist/typeshed-fallback/stubs/m3u8/m3u8/httpclient.pyi +19 -0
  95. package/dist/typeshed-fallback/stubs/m3u8/m3u8/mixins.pyi +25 -0
  96. package/dist/typeshed-fallback/stubs/m3u8/m3u8/model.pyi +406 -0
  97. package/dist/typeshed-fallback/stubs/m3u8/m3u8/parser.pyi +14 -0
  98. package/dist/typeshed-fallback/stubs/m3u8/m3u8/protocol.pyi +41 -0
  99. package/dist/typeshed-fallback/stubs/m3u8/m3u8/version_matching.pyi +5 -0
  100. package/dist/typeshed-fallback/stubs/m3u8/m3u8/version_matching_rules.pyi +24 -0
  101. package/dist/typeshed-fallback/stubs/paramiko/paramiko/transport.pyi +2 -1
  102. package/dist/typeshed-fallback/stubs/protobuf/METADATA.toml +2 -2
  103. package/dist/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +4 -3
  104. package/dist/typeshed-fallback/stubs/protobuf/google/protobuf/internal/well_known_types.pyi +0 -1
  105. package/dist/typeshed-fallback/stubs/pytz/pytz/__init__.pyi +4 -4
  106. package/dist/typeshed-fallback/stubs/pytz/pytz/tzinfo.pyi +1 -1
  107. package/dist/typeshed-fallback/stubs/qrcode/METADATA.toml +3 -2
  108. package/dist/typeshed-fallback/stubs/redis/redis/client.pyi +18 -0
  109. package/dist/typeshed-fallback/stubs/reportlab/METADATA.toml +1 -1
  110. package/dist/typeshed-fallback/stubs/reportlab/reportlab/graphics/renderPDF.pyi +2 -2
  111. package/dist/typeshed-fallback/stubs/seaborn/METADATA.toml +9 -1
  112. package/dist/typeshed-fallback/stubs/vobject/vobject/__init__.pyi +4 -0
  113. package/dist/typeshed-fallback/stubs/vobject/vobject/base.pyi +11 -2
  114. package/dist/typeshed-fallback/stubs/vobject/vobject/behavior.pyi +1 -1
  115. package/dist/typeshed-fallback/stubs/vobject/vobject/change_tz.pyi +4 -0
  116. package/dist/typeshed-fallback/stubs/vobject/vobject/ics_diff.pyi +0 -3
  117. package/dist/typeshed-fallback/stubs/vobject/vobject/vcard.pyi +1 -1
  118. package/dist/typeshed-fallback/stubs/waitress/waitress/__init__.pyi +2 -2
  119. package/package.json +1 -1
  120. package/dist/typeshed-fallback/stubs/Pillow/METADATA.toml +0 -8
  121. package/dist/typeshed-fallback/stubs/Pillow/PIL/BdfFontFile.pyi +0 -11
  122. package/dist/typeshed-fallback/stubs/Pillow/PIL/BlpImagePlugin.pyi +0 -39
  123. package/dist/typeshed-fallback/stubs/Pillow/PIL/BmpImagePlugin.pyi +0 -25
  124. package/dist/typeshed-fallback/stubs/Pillow/PIL/BufrStubImagePlugin.pyi +0 -9
  125. package/dist/typeshed-fallback/stubs/Pillow/PIL/ContainerIO.pyi +0 -14
  126. package/dist/typeshed-fallback/stubs/Pillow/PIL/CurImagePlugin.pyi +0 -6
  127. package/dist/typeshed-fallback/stubs/Pillow/PIL/DcxImagePlugin.pyi +0 -13
  128. package/dist/typeshed-fallback/stubs/Pillow/PIL/DdsImagePlugin.pyi +0 -314
  129. package/dist/typeshed-fallback/stubs/Pillow/PIL/EpsImagePlugin.pyi +0 -34
  130. package/dist/typeshed-fallback/stubs/Pillow/PIL/ExifTags.pyi +0 -347
  131. package/dist/typeshed-fallback/stubs/Pillow/PIL/FitsImagePlugin.pyi +0 -7
  132. package/dist/typeshed-fallback/stubs/Pillow/PIL/FliImagePlugin.pyi +0 -9
  133. package/dist/typeshed-fallback/stubs/Pillow/PIL/FontFile.pyi +0 -16
  134. package/dist/typeshed-fallback/stubs/Pillow/PIL/FpxImagePlugin.pyi +0 -23
  135. package/dist/typeshed-fallback/stubs/Pillow/PIL/FtexImagePlugin.pyi +0 -15
  136. package/dist/typeshed-fallback/stubs/Pillow/PIL/GbrImagePlugin.pyi +0 -11
  137. package/dist/typeshed-fallback/stubs/Pillow/PIL/GdImageFile.pyi +0 -9
  138. package/dist/typeshed-fallback/stubs/Pillow/PIL/GifImagePlugin.pyi +0 -31
  139. package/dist/typeshed-fallback/stubs/Pillow/PIL/GimpGradientFile.pyi +0 -19
  140. package/dist/typeshed-fallback/stubs/Pillow/PIL/GimpPaletteFile.pyi +0 -7
  141. package/dist/typeshed-fallback/stubs/Pillow/PIL/GribStubImagePlugin.pyi +0 -9
  142. package/dist/typeshed-fallback/stubs/Pillow/PIL/Hdf5StubImagePlugin.pyi +0 -9
  143. package/dist/typeshed-fallback/stubs/Pillow/PIL/IcnsImagePlugin.pyi +0 -36
  144. package/dist/typeshed-fallback/stubs/Pillow/PIL/IcoImagePlugin.pyi +0 -26
  145. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImImagePlugin.pyi +0 -34
  146. package/dist/typeshed-fallback/stubs/Pillow/PIL/Image.pyi +0 -342
  147. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageChops.pyi +0 -23
  148. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageCms.pyi +0 -84
  149. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageColor.pyi +0 -10
  150. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageDraw.pyi +0 -155
  151. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageDraw2.pyi +0 -37
  152. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageEnhance.pyi +0 -25
  153. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageFile.pyi +0 -89
  154. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageFilter.pyi +0 -136
  155. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageFont.pyi +0 -114
  156. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageGrab.pyi +0 -36
  157. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageMath.pyi +0 -49
  158. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageMode.pyi +0 -10
  159. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageMorph.pyi +0 -26
  160. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageOps.pyi +0 -53
  161. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImagePalette.pyi +0 -26
  162. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImagePath.pyi +0 -3
  163. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageQt.pyi +0 -26
  164. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageSequence.pyi +0 -14
  165. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageShow.pyi +0 -58
  166. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageStat.pyi +0 -14
  167. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageTk.pyi +0 -51
  168. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageTransform.pyi +0 -21
  169. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImageWin.pyi +0 -38
  170. package/dist/typeshed-fallback/stubs/Pillow/PIL/ImtImagePlugin.pyi +0 -10
  171. package/dist/typeshed-fallback/stubs/Pillow/PIL/IptcImagePlugin.pyi +0 -23
  172. package/dist/typeshed-fallback/stubs/Pillow/PIL/Jpeg2KImagePlugin.pyi +0 -23
  173. package/dist/typeshed-fallback/stubs/Pillow/PIL/JpegImagePlugin.pyi +0 -30
  174. package/dist/typeshed-fallback/stubs/Pillow/PIL/JpegPresets.pyi +0 -3
  175. package/dist/typeshed-fallback/stubs/Pillow/PIL/McIdasImagePlugin.pyi +0 -7
  176. package/dist/typeshed-fallback/stubs/Pillow/PIL/MicImagePlugin.pyi +0 -18
  177. package/dist/typeshed-fallback/stubs/Pillow/PIL/MpegImagePlugin.pyi +0 -18
  178. package/dist/typeshed-fallback/stubs/Pillow/PIL/MpoImagePlugin.pyi +0 -15
  179. package/dist/typeshed-fallback/stubs/Pillow/PIL/MspImagePlugin.pyi +0 -10
  180. package/dist/typeshed-fallback/stubs/Pillow/PIL/PSDraw.pyi +0 -19
  181. package/dist/typeshed-fallback/stubs/Pillow/PIL/PaletteFile.pyi +0 -7
  182. package/dist/typeshed-fallback/stubs/Pillow/PIL/PalmImagePlugin.pyi +0 -5
  183. package/dist/typeshed-fallback/stubs/Pillow/PIL/PcdImagePlugin.pyi +0 -10
  184. package/dist/typeshed-fallback/stubs/Pillow/PIL/PcfFontFile.pyi +0 -25
  185. package/dist/typeshed-fallback/stubs/Pillow/PIL/PcxImagePlugin.pyi +0 -10
  186. package/dist/typeshed-fallback/stubs/Pillow/PIL/PdfParser.pyi +0 -167
  187. package/dist/typeshed-fallback/stubs/Pillow/PIL/PixarImagePlugin.pyi +0 -7
  188. package/dist/typeshed-fallback/stubs/Pillow/PIL/PngImagePlugin.pyi +0 -115
  189. package/dist/typeshed-fallback/stubs/Pillow/PIL/PpmImagePlugin.pyi +0 -17
  190. package/dist/typeshed-fallback/stubs/Pillow/PIL/PsdImagePlugin.pyi +0 -17
  191. package/dist/typeshed-fallback/stubs/Pillow/PIL/PyAccess.pyi +0 -69
  192. package/dist/typeshed-fallback/stubs/Pillow/PIL/QoiImagePlugin.pyi +0 -11
  193. package/dist/typeshed-fallback/stubs/Pillow/PIL/SgiImagePlugin.pyi +0 -13
  194. package/dist/typeshed-fallback/stubs/Pillow/PIL/SpiderImagePlugin.pyi +0 -28
  195. package/dist/typeshed-fallback/stubs/Pillow/PIL/SunImagePlugin.pyi +0 -7
  196. package/dist/typeshed-fallback/stubs/Pillow/PIL/TarIO.pyi +0 -12
  197. package/dist/typeshed-fallback/stubs/Pillow/PIL/TgaImagePlugin.pyi +0 -12
  198. package/dist/typeshed-fallback/stubs/Pillow/PIL/TiffImagePlugin.pyi +0 -295
  199. package/dist/typeshed-fallback/stubs/Pillow/PIL/TiffTags.pyi +0 -46
  200. package/dist/typeshed-fallback/stubs/Pillow/PIL/WalImageFile.pyi +0 -14
  201. package/dist/typeshed-fallback/stubs/Pillow/PIL/WebPImagePlugin.pyi +0 -18
  202. package/dist/typeshed-fallback/stubs/Pillow/PIL/WmfImagePlugin.pyi +0 -19
  203. package/dist/typeshed-fallback/stubs/Pillow/PIL/XVThumbImagePlugin.pyi +0 -9
  204. package/dist/typeshed-fallback/stubs/Pillow/PIL/XbmImagePlugin.pyi +0 -10
  205. package/dist/typeshed-fallback/stubs/Pillow/PIL/XpmImagePlugin.pyi +0 -11
  206. package/dist/typeshed-fallback/stubs/Pillow/PIL/__init__.pyi +0 -3
  207. package/dist/typeshed-fallback/stubs/Pillow/PIL/_binary.pyi +0 -13
  208. package/dist/typeshed-fallback/stubs/Pillow/PIL/_imaging.pyi +0 -29
  209. package/dist/typeshed-fallback/stubs/Pillow/PIL/_tkinter_finder.pyi +0 -2
  210. package/dist/typeshed-fallback/stubs/Pillow/PIL/_version.pyi +0 -1
  211. package/dist/typeshed-fallback/stubs/Pillow/PIL/features.pyi +0 -23
  212. package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone_cache.pyi +0 -0
  213. /package/dist/typeshed-fallback/stubs/icalendar/icalendar/{windows_to_olson.pyi → timezone/windows_to_olson.pyi} +0 -0
  214. /package/dist/typeshed-fallback/stubs/{Pillow/PIL/PdfImagePlugin.pyi → jwcrypto/jwcrypto/__init__.pyi} +0 -0
@@ -1,19 +1,14 @@
1
1
  import sys
2
2
  from _typeshed import SupportsKeysAndGetItem
3
- from _weakref import (
4
- CallableProxyType as CallableProxyType,
5
- ProxyType as ProxyType,
6
- ReferenceType as ReferenceType,
7
- getweakrefcount as getweakrefcount,
8
- getweakrefs as getweakrefs,
9
- proxy as proxy,
10
- ref as ref,
11
- )
3
+ from _weakref import getweakrefcount as getweakrefcount, getweakrefs as getweakrefs, proxy as proxy
12
4
  from _weakrefset import WeakSet as WeakSet
13
5
  from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping
14
- from typing import Any, Generic, TypeVar, overload
6
+ from typing import Any, Generic, TypeVar, final, overload
15
7
  from typing_extensions import ParamSpec, Self
16
8
 
9
+ if sys.version_info >= (3, 9):
10
+ from types import GenericAlias
11
+
17
12
  __all__ = [
18
13
  "ref",
19
14
  "proxy",
@@ -40,11 +35,51 @@ _P = ParamSpec("_P")
40
35
 
41
36
  ProxyTypes: tuple[type[Any], ...]
42
37
 
38
+ # These classes are implemented in C and imported from _weakref at runtime. However,
39
+ # they consider themselves to live in the weakref module for sys.version_info >= (3, 11),
40
+ # so defining their stubs here means we match their __module__ value.
41
+ # Prior to 3.11 they did not declare a module for themselves and ended up looking like they
42
+ # came from the builtin module at runtime, which was just wrong, and we won't attempt to
43
+ # duplicate that.
44
+
45
+ @final
46
+ class CallableProxyType(Generic[_CallableT]): # "weakcallableproxy"
47
+ def __eq__(self, value: object, /) -> bool:
48
+ """Return self==value."""
49
+ ...
50
+ def __getattr__(self, attr: str) -> Any: ...
51
+ __call__: _CallableT
52
+
53
+ @final
54
+ class ProxyType(Generic[_T]): # "weakproxy"
55
+ def __eq__(self, value: object, /) -> bool:
56
+ """Return self==value."""
57
+ ...
58
+ def __getattr__(self, attr: str) -> Any: ...
59
+
60
+ class ReferenceType(Generic[_T]): # "weakref"
61
+ __callback__: Callable[[ReferenceType[_T]], Any]
62
+ def __new__(cls, o: _T, callback: Callable[[ReferenceType[_T]], Any] | None = ..., /) -> Self: ...
63
+ def __call__(self) -> _T | None:
64
+ """Call self as a function."""
65
+ ...
66
+ def __eq__(self, value: object, /) -> bool:
67
+ """Return self==value."""
68
+ ...
69
+ def __hash__(self) -> int:
70
+ """Return hash(self)."""
71
+ ...
72
+ if sys.version_info >= (3, 9):
73
+ def __class_getitem__(cls, item: Any, /) -> GenericAlias:
74
+ """See PEP 585"""
75
+ ...
76
+
77
+ ref = ReferenceType
78
+
79
+ # everything below here is implemented in weakref.py
80
+
43
81
  class WeakMethod(ref[_CallableT]):
44
- # `ref` is implemented in `C` so positional-only arguments are enforced, but not in `WeakMethod`.
45
- def __new__( # pyright: ignore[reportInconsistentConstructor]
46
- cls, meth: _CallableT, callback: Callable[[Self], Any] | None = None
47
- ) -> Self: ...
82
+ def __new__(cls, meth: _CallableT, callback: Callable[[Self], Any] | None = None) -> Self: ...
48
83
  def __call__(self) -> _CallableT | None: ...
49
84
  def __eq__(self, other: object) -> bool: ...
50
85
  def __ne__(self, other: object) -> bool: ...
@@ -1 +1,7 @@
1
1
  from pyexpat import *
2
+
3
+ # This is actually implemented in the C module pyexpat, but considers itself to live here.
4
+ class ExpatError(Exception):
5
+ code: int
6
+ lineno: int
7
+ offset: int
@@ -200,7 +200,7 @@ def dumps(
200
200
  allow_none: bool = False,
201
201
  ) -> str: ...
202
202
  def loads(
203
- data: str, use_datetime: bool = False, use_builtin_types: bool = False
203
+ data: str | ReadableBuffer, use_datetime: bool = False, use_builtin_types: bool = False
204
204
  ) -> tuple[tuple[_Marshallable, ...], str | None]: ...
205
205
  def gzip_encode(data: ReadableBuffer) -> bytes: ... # undocumented
206
206
  def gzip_decode(data: ReadableBuffer, max_decode: int = 20971520) -> bytes: ... # undocumented
@@ -1,6 +1,7 @@
1
1
  import http.server
2
2
  import pydoc
3
3
  import socketserver
4
+ from _typeshed import ReadableBuffer
4
5
  from collections.abc import Callable, Iterable, Mapping
5
6
  from re import Pattern
6
7
  from typing import Any, ClassVar, Protocol
@@ -48,8 +49,8 @@ class SimpleXMLRPCDispatcher: # undocumented
48
49
  def register_multicall_functions(self) -> None: ...
49
50
  def _marshaled_dispatch(
50
51
  self,
51
- data: str,
52
- dispatch_method: Callable[[str | None, tuple[_Marshallable, ...]], Fault | tuple[_Marshallable, ...]] | None = None,
52
+ data: str | ReadableBuffer,
53
+ dispatch_method: Callable[[str, tuple[_Marshallable, ...]], Fault | tuple[_Marshallable, ...]] | None = None,
53
54
  path: Any | None = None,
54
55
  ) -> str: ... # undocumented
55
56
  def system_listMethods(self) -> list[str]: ... # undocumented
@@ -1,50 +1,47 @@
1
- from _typeshed import StrPath
2
- from collections.abc import Iterable, Sequence
1
+ import sys
2
+ from collections.abc import Iterable
3
3
  from datetime import datetime, timedelta, tzinfo
4
- from typing import Any, Protocol
5
4
  from typing_extensions import Self
6
5
 
7
- __all__ = ["ZoneInfo", "reset_tzpath", "available_timezones", "TZPATH", "ZoneInfoNotFoundError", "InvalidTZPathWarning"]
6
+ # TODO: remove this version check
7
+ # In theory we shouldn't need this version check. Pyright complains about the imports
8
+ # from zoneinfo.* when run on 3.8 and 3.7 without this. Updates to typeshed's
9
+ # pyright test script are probably needed, see #11189
10
+ if sys.version_info >= (3, 9):
11
+ from zoneinfo._common import ZoneInfoNotFoundError as ZoneInfoNotFoundError, _IOBytes
12
+ from zoneinfo._tzpath import (
13
+ TZPATH as TZPATH,
14
+ InvalidTZPathWarning as InvalidTZPathWarning,
15
+ available_timezones as available_timezones,
16
+ reset_tzpath as reset_tzpath,
17
+ )
8
18
 
9
- class _IOBytes(Protocol):
10
- def read(self, size: int, /) -> bytes: ...
11
- def seek(self, size: int, whence: int = ..., /) -> Any: ...
19
+ __all__ = ["ZoneInfo", "reset_tzpath", "available_timezones", "TZPATH", "ZoneInfoNotFoundError", "InvalidTZPathWarning"]
12
20
 
13
- class ZoneInfo(tzinfo):
14
- @property
15
- def key(self) -> str: ...
16
- def __init__(self, key: str) -> None: ...
17
- @classmethod
18
- def no_cache(cls, key: str) -> Self:
19
- """Get a new instance of ZoneInfo, bypassing the cache."""
20
- ...
21
- @classmethod
22
- def from_file(cls, fobj: _IOBytes, /, key: str | None = None) -> Self:
23
- """Create a ZoneInfo file from a file object."""
24
- ...
25
- @classmethod
26
- def clear_cache(cls, *, only_keys: Iterable[str] | None = None) -> None:
27
- """Clear the ZoneInfo cache."""
28
- ...
29
- def tzname(self, dt: datetime | None, /) -> str | None:
30
- """Retrieve a string containing the abbreviation for the time zone that applies in a zone at a given datetime."""
31
- ...
32
- def utcoffset(self, dt: datetime | None, /) -> timedelta | None:
33
- """Retrieve a timedelta representing the UTC offset in a zone at the given datetime."""
34
- ...
35
- def dst(self, dt: datetime | None, /) -> timedelta | None:
36
- """Retrieve a timedelta representing the amount of DST applied in a zone at the given datetime."""
37
- ...
21
+ class ZoneInfo(tzinfo):
22
+ @property
23
+ def key(self) -> str: ...
24
+ def __init__(self, key: str) -> None: ...
25
+ @classmethod
26
+ def no_cache(cls, key: str) -> Self:
27
+ """Get a new instance of ZoneInfo, bypassing the cache."""
28
+ ...
29
+ @classmethod
30
+ def from_file(cls, fobj: _IOBytes, /, key: str | None = None) -> Self:
31
+ """Create a ZoneInfo file from a file object."""
32
+ ...
33
+ @classmethod
34
+ def clear_cache(cls, *, only_keys: Iterable[str] | None = None) -> None:
35
+ """Clear the ZoneInfo cache."""
36
+ ...
37
+ def tzname(self, dt: datetime | None, /) -> str | None:
38
+ """Retrieve a string containing the abbreviation for the time zone that applies in a zone at a given datetime."""
39
+ ...
40
+ def utcoffset(self, dt: datetime | None, /) -> timedelta | None:
41
+ """Retrieve a timedelta representing the UTC offset in a zone at the given datetime."""
42
+ ...
43
+ def dst(self, dt: datetime | None, /) -> timedelta | None:
44
+ """Retrieve a timedelta representing the amount of DST applied in a zone at the given datetime."""
45
+ ...
38
46
 
39
- # Note: Both here and in clear_cache, the types allow the use of `str` where
40
- # a sequence of strings is required. This should be remedied if a solution
41
- # to this typing bug is found: https://github.com/python/typing/issues/256
42
- def reset_tzpath(to: Sequence[StrPath] | None = None) -> None: ...
43
- def available_timezones() -> set[str]: ...
44
-
45
- TZPATH: tuple[str, ...]
46
-
47
- class ZoneInfoNotFoundError(KeyError): ...
48
- class InvalidTZPathWarning(RuntimeWarning): ...
49
-
50
- def __dir__() -> list[str]: ...
47
+ def __dir__() -> list[str]: ...
@@ -0,0 +1,13 @@
1
+ import io
2
+ from typing import Any, Protocol
3
+
4
+ class _IOBytes(Protocol):
5
+ def read(self, size: int, /) -> bytes: ...
6
+ def seek(self, size: int, whence: int = ..., /) -> Any: ...
7
+
8
+ def load_tzdata(key: str) -> io.BufferedReader: ...
9
+ def load_data(
10
+ fobj: _IOBytes,
11
+ ) -> tuple[tuple[int, ...], tuple[int, ...], tuple[int, ...], tuple[int, ...], tuple[str, ...], bytes | None]: ...
12
+
13
+ class ZoneInfoNotFoundError(KeyError): ...
@@ -0,0 +1,13 @@
1
+ from _typeshed import StrPath
2
+ from collections.abc import Sequence
3
+
4
+ # Note: Both here and in clear_cache, the types allow the use of `str` where
5
+ # a sequence of strings is required. This should be remedied if a solution
6
+ # to this typing bug is found: https://github.com/python/typing/issues/256
7
+ def reset_tzpath(to: Sequence[StrPath] | None = None) -> None: ...
8
+ def find_tzfile(key: str) -> str | None: ...
9
+ def available_timezones() -> set[str]: ...
10
+
11
+ TZPATH: tuple[str, ...]
12
+
13
+ class InvalidTZPathWarning(RuntimeWarning): ...
@@ -1,3 +1,3 @@
1
- version = "5.3.*"
1
+ version = "5.4.*"
2
2
  requires = ["Flask>=0.9"]
3
3
  upstream_repository = "https://github.com/miguelgrinberg/flask-socketio"
@@ -1,2 +1,2 @@
1
- version = "4.29.*"
1
+ version = "4.30.*"
2
2
  upstream_repository = "https://github.com/braintree/braintree_python"
@@ -103,6 +103,7 @@ class ErrorCodes:
103
103
  ExpirationYearIsInvalid: Final = "81713"
104
104
  InvalidParamsForCreditCardUpdate: Final = "91745"
105
105
  InvalidVenmoSDKPaymentMethodCode: Final = "91727"
106
+ NetworkTokenizationAttributeCryptogramIsRequired: Final = "81762"
106
107
  NumberHasInvalidLength: Final = "81716"
107
108
  NumberLengthIsInvalid: Final = "81716"
108
109
  NumberIsInvalid: Final = "81715"
@@ -1,6 +1,8 @@
1
1
  from typing import Any, ClassVar, NamedTuple
2
2
  from typing_extensions import Self
3
3
 
4
+ from docutils.transforms import Transform
5
+
4
6
  __docformat__: str
5
7
  __version__: str
6
8
 
@@ -32,7 +34,7 @@ class SettingsSpec:
32
34
  config_section_dependencies: ClassVar[tuple[str, ...] | None]
33
35
 
34
36
  class TransformSpec:
35
- def get_transforms(self) -> list[Any]: ...
37
+ def get_transforms(self) -> list[type[Transform]]: ...
36
38
  default_transforms: ClassVar[tuple[Any, ...]]
37
39
  unknown_reference_resolvers: ClassVar[list[Any]]
38
40
 
@@ -5,7 +5,6 @@ from configparser import RawConfigParser
5
5
  from typing import Any, ClassVar
6
6
 
7
7
  from docutils import SettingsSpec
8
- from docutils.parsers import Parser
9
8
  from docutils.utils import DependencyList
10
9
 
11
10
  __docformat__: str
@@ -113,7 +112,7 @@ class OptionParser(optparse.OptionParser, SettingsSpec):
113
112
  version_template: ClassVar[str]
114
113
  def __init__(
115
114
  self,
116
- components: Iterable[type[Parser]] = (),
115
+ components: Iterable[SettingsSpec | type[SettingsSpec]] = (),
117
116
  defaults: Mapping[str, Any] | None = None,
118
117
  read_config_files: bool | None = False,
119
118
  *args,
@@ -1,3 +1,16 @@
1
- from _typeshed import Incomplete
1
+ from docutils import nodes
2
+ from docutils.parsers.rst import Directive
2
3
 
3
- def __getattr__(name: str) -> Incomplete: ...
4
+ class BaseAdmonition(Directive):
5
+ node_class: type[nodes.Admonition] # Subclasses must set this to the appropriate admonition node class.
6
+
7
+ class Admonition(BaseAdmonition): ...
8
+ class Attention(BaseAdmonition): ...
9
+ class Caution(BaseAdmonition): ...
10
+ class Danger(BaseAdmonition): ...
11
+ class Error(BaseAdmonition): ...
12
+ class Hint(BaseAdmonition): ...
13
+ class Important(BaseAdmonition): ...
14
+ class Note(BaseAdmonition): ...
15
+ class Tip(BaseAdmonition): ...
16
+ class Warning(BaseAdmonition): ...
@@ -2,6 +2,6 @@ from typing import TypeVar
2
2
 
3
3
  from docutils import readers
4
4
 
5
- _S = TypeVar("_S")
5
+ _S = TypeVar("_S", bound=str | bytes)
6
6
 
7
7
  class Reader(readers.ReReader[_S]): ...
@@ -1,3 +1,22 @@
1
- from _typeshed import Incomplete
1
+ from typing import Any, Generic, TypeVar
2
2
 
3
- def __getattr__(name: str) -> Incomplete: ...
3
+ from docutils import Component, nodes
4
+ from docutils.io import Output
5
+ from docutils.languages import LanguageImporter
6
+
7
+ _S = TypeVar("_S")
8
+
9
+ class Writer(Component, Generic[_S]):
10
+ parts: dict[str, Any]
11
+ language: LanguageImporter | None = None
12
+ def __init__(self) -> None: ...
13
+ document: nodes.document | None = None
14
+ destination: Output | None = None
15
+ output: _S | None = None
16
+ def assemble_parts(self) -> None: ...
17
+ def translate(self) -> None: ...
18
+ def write(self, document: nodes.document, destination: Output) -> str | bytes | None: ...
19
+
20
+ class UnfilteredWriter(Writer[_S]): ...
21
+
22
+ def get_writer_class(writer_name: str) -> type[Writer[Any]]: ...
@@ -450,7 +450,7 @@ class FPDF(GraphicsStateMixin):
450
450
  ln: int | Literal["DEPRECATED"] = "DEPRECATED",
451
451
  align: str | Align = ...,
452
452
  fill: bool = False,
453
- link: str = "",
453
+ link: str | int = "",
454
454
  center: bool = False,
455
455
  markdown: bool = False,
456
456
  new_x: XPos | str = ...,
@@ -467,7 +467,7 @@ class FPDF(GraphicsStateMixin):
467
467
  align: str | Align = ...,
468
468
  fill: bool = False,
469
469
  split_only: bool = False,
470
- link: str = "",
470
+ link: str | int = "",
471
471
  ln: int | Literal["DEPRECATED"] = "DEPRECATED",
472
472
  max_line_height: float | None = None,
473
473
  markdown: bool = False,
@@ -481,7 +481,7 @@ class FPDF(GraphicsStateMixin):
481
481
  padding: int = 0,
482
482
  ): ...
483
483
  def write(
484
- self, h: float | None = None, text: str = "", link: str = "", print_sh: bool = False, wrapmode: WrapMode = ...
484
+ self, h: float | None = None, text: str = "", link: str | int = "", print_sh: bool = False, wrapmode: WrapMode = ...
485
485
  ) -> bool: ...
486
486
  def text_columns(
487
487
  self,
@@ -507,7 +507,7 @@ class FPDF(GraphicsStateMixin):
507
507
  w: float = 0,
508
508
  h: float = 0,
509
509
  type: str = "",
510
- link: str = "",
510
+ link: str | int = "",
511
511
  title: str | None = None,
512
512
  alt_text: str | None = None,
513
513
  dims: tuple[float, float] | None = None,
@@ -1,2 +1,2 @@
1
- version = "3.0.*"
1
+ version = "3.1.*"
2
2
  upstream_repository = "https://github.com/python-greenlet/greenlet"
@@ -1,2 +1,2 @@
1
- version = "2.21.*"
1
+ version = "2.22.*"
2
2
  # upstream_repository = closed-source
@@ -1,3 +1,6 @@
1
- version = "5.0.*"
1
+ version = "6.0.*"
2
2
  upstream_repository = "https://github.com/collective/icalendar"
3
- requires = ["types-pytz"]
3
+ requires = ["types-python-dateutil", "backports.zoneinfo; python_version<'3.9'"]
4
+
5
+ [tool.stubtest]
6
+ stubtest_requirements = ["pytz"]
@@ -1,8 +1,7 @@
1
- from typing import Final
2
-
3
1
  from .cal import (
4
2
  Alarm as Alarm,
5
3
  Calendar as Calendar,
4
+ Component as Component,
6
5
  ComponentFactory as ComponentFactory,
7
6
  Event as Event,
8
7
  FreeBusy as FreeBusy,
@@ -14,8 +13,6 @@ from .cal import (
14
13
  )
15
14
  from .parser import Parameters as Parameters, q_join as q_join, q_split as q_split
16
15
  from .prop import (
17
- FixedOffset as FixedOffset,
18
- LocalTimezone as LocalTimezone,
19
16
  TypesFactory as TypesFactory,
20
17
  vBinary as vBinary,
21
18
  vBoolean as vBoolean,
@@ -36,5 +33,52 @@ from .prop import (
36
33
  vUTCOffset as vUTCOffset,
37
34
  vWeekday as vWeekday,
38
35
  )
36
+ from .timezone import use_pytz, use_zoneinfo
37
+ from .version import (
38
+ __version__ as __version__,
39
+ __version_tuple__ as __version_tuple__,
40
+ version as version,
41
+ version_tuple as version_tuple,
42
+ )
39
43
 
40
- __version__: Final[str]
44
+ __all__ = [
45
+ "Calendar",
46
+ "Event",
47
+ "Todo",
48
+ "Journal",
49
+ "Timezone",
50
+ "TimezoneStandard",
51
+ "TimezoneDaylight",
52
+ "FreeBusy",
53
+ "Alarm",
54
+ "ComponentFactory",
55
+ "vBinary",
56
+ "vBoolean",
57
+ "vCalAddress",
58
+ "vDatetime",
59
+ "vDate",
60
+ "vDDDTypes",
61
+ "vDuration",
62
+ "vFloat",
63
+ "vInt",
64
+ "vPeriod",
65
+ "vWeekday",
66
+ "vFrequency",
67
+ "vRecur",
68
+ "vText",
69
+ "vTime",
70
+ "vUri",
71
+ "vGeo",
72
+ "vUTCOffset",
73
+ "Parameters",
74
+ "q_split",
75
+ "q_join",
76
+ "use_pytz",
77
+ "use_zoneinfo",
78
+ "__version__",
79
+ "version",
80
+ "__version_tuple__",
81
+ "version_tuple",
82
+ "TypesFactory",
83
+ "Component",
84
+ ]
@@ -1,12 +1,31 @@
1
+ import datetime
1
2
  from _typeshed import Incomplete, SupportsItems
3
+ from collections.abc import Callable
2
4
  from typing import Any, ClassVar, Final, Literal, overload
3
5
 
4
- from pytz.tzinfo import DstTzInfo
5
-
6
6
  from .caselessdict import CaselessDict
7
7
  from .parser import Contentline, Contentlines
8
8
  from .prop import TypesFactory
9
9
 
10
+ __all__ = [
11
+ "Alarm",
12
+ "Calendar",
13
+ "Component",
14
+ "ComponentFactory",
15
+ "Event",
16
+ "FreeBusy",
17
+ "INLINE",
18
+ "Journal",
19
+ "Timezone",
20
+ "TimezoneDaylight",
21
+ "TimezoneStandard",
22
+ "Todo",
23
+ "component_factory",
24
+ "get_example",
25
+ ]
26
+
27
+ def get_example(component_directory: str, example_name: str) -> bytes: ...
28
+
10
29
  class ComponentFactory(CaselessDict[Incomplete]):
11
30
  def __init__(self, *args, **kwargs) -> None: ...
12
31
 
@@ -27,8 +46,6 @@ class Component(CaselessDict[Incomplete]):
27
46
  def __bool__(self) -> bool: ...
28
47
  __nonzero__ = __bool__
29
48
  def is_empty(self) -> bool: ...
30
- @property
31
- def is_broken(self) -> bool: ...
32
49
  @overload
33
50
  def add(self, name: str, value: Any, *, encode: Literal[False]) -> None: ...
34
51
  @overload
@@ -41,7 +58,7 @@ class Component(CaselessDict[Incomplete]):
41
58
  def get_inline(self, name, decode: bool = True): ...
42
59
  def set_inline(self, name, values, encode: bool = True) -> None: ...
43
60
  def add_component(self, component: Component) -> None: ...
44
- def walk(self, name: Incomplete | None = None): ...
61
+ def walk(self, name: str | None = None, select: Callable[[Component], bool] = ...): ...
45
62
  def property_items(self, recursive: bool = True, sorted: bool = True): ...
46
63
  @overload
47
64
  @classmethod
@@ -56,6 +73,8 @@ class Component(CaselessDict[Incomplete]):
56
73
 
57
74
  class Event(Component):
58
75
  name: ClassVar[Literal["VEVENT"]]
76
+ @classmethod
77
+ def example(cls, name: str) -> Event: ...
59
78
 
60
79
  class Todo(Component):
61
80
  name: ClassVar[Literal["VTODO"]]
@@ -68,7 +87,12 @@ class FreeBusy(Component):
68
87
 
69
88
  class Timezone(Component):
70
89
  name: ClassVar[Literal["VTIMEZONE"]]
71
- def to_tz(self) -> DstTzInfo: ...
90
+ @classmethod
91
+ def example(cls, name: str) -> Calendar: ...
92
+ def to_tz(self, tzp=...): ... # FIXME -> DstTzInfo: ...
93
+ @property
94
+ def tz_name(self) -> str: ...
95
+ def get_transitions(self) -> tuple[list[datetime.datetime], list[tuple[datetime.timedelta, datetime.timedelta, str]]]: ...
72
96
 
73
97
  class TimezoneStandard(Component):
74
98
  name: ClassVar[Literal["STANDARD"]]
@@ -81,6 +105,8 @@ class Alarm(Component):
81
105
 
82
106
  class Calendar(Component):
83
107
  name: ClassVar[Literal["VCALENDAR"]]
108
+ @classmethod
109
+ def example(cls, name: str) -> Calendar: ...
84
110
 
85
111
  types_factory: Final[TypesFactory]
86
112
  component_factory: Final[ComponentFactory]
@@ -4,6 +4,8 @@ from collections.abc import Iterable, Mapping
4
4
  from typing import ClassVar, TypeVar, overload
5
5
  from typing_extensions import Self
6
6
 
7
+ __all__ = ["canonsort_keys", "canonsort_items", "CaselessDict"]
8
+
7
9
  _T = TypeVar("_T")
8
10
  _VT = TypeVar("_VT")
9
11
 
@@ -7,9 +7,33 @@ from typing_extensions import Self
7
7
 
8
8
  from .caselessdict import CaselessDict
9
9
 
10
+ __all__ = [
11
+ "Contentline",
12
+ "Contentlines",
13
+ "FOLD",
14
+ "NAME",
15
+ "NEWLINE",
16
+ "Parameters",
17
+ "QUNSAFE_CHAR",
18
+ "QUOTABLE",
19
+ "UNSAFE_CHAR",
20
+ "dquote",
21
+ "escape_char",
22
+ "escape_string",
23
+ "foldline",
24
+ "param_value",
25
+ "q_join",
26
+ "q_split",
27
+ "uFOLD",
28
+ "unescape_char",
29
+ "unescape_list_or_string",
30
+ "unescape_string",
31
+ "validate_param_value",
32
+ "validate_token",
33
+ ]
34
+
10
35
  def escape_char(text: str) -> str: ...
11
36
  def unescape_char(text: AnyStr) -> AnyStr: ...
12
- def tzid_from_dt(dt): ...
13
37
  def foldline(line: str, limit: int = 75, fold_sep: str = "\r\n ") -> str: ...
14
38
  def param_value(value: str | list[str] | tuple[str, ...] | Incomplete) -> str: ...
15
39
 
@@ -1,14 +1,18 @@
1
1
  from typing import Any, Final, TypeVar, overload
2
+ from typing_extensions import TypeAlias
2
3
 
3
4
  _T = TypeVar("_T")
4
5
 
6
+ __all__ = ["DEFAULT_ENCODING", "SEQUENCE_TYPES", "ICAL_TYPE", "data_encode", "from_unicode", "to_unicode"]
7
+
5
8
  SEQUENCE_TYPES: Final[tuple[type[Any], ...]]
6
9
  DEFAULT_ENCODING: str
10
+ ICAL_TYPE: TypeAlias = str | bytes
7
11
 
8
- def from_unicode(value: str | bytes, encoding: str = "utf-8") -> bytes: ...
9
- def to_unicode(value: str | bytes, encoding: str = "utf-8") -> str: ...
12
+ def from_unicode(value: ICAL_TYPE, encoding: str = "utf-8") -> bytes: ...
13
+ def to_unicode(value: ICAL_TYPE, encoding: str = "utf-8-sig") -> str: ...
10
14
  @overload
11
- def data_encode(data: str, encoding: str = ...) -> bytes: ...
15
+ def data_encode(data: ICAL_TYPE, encoding: str = ...) -> bytes: ...
12
16
  @overload
13
17
  def data_encode(data: dict[Any, Any], encoding: str = ...) -> dict[Any, Any]: ...
14
18
  @overload