basedpyright 1.1.389 → 1.1.392
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.
- package/README.md +3 -3
- package/dist/pyright-langserver.js +1 -1
- package/dist/pyright-langserver.js.LICENSE.txt +42 -0
- package/dist/pyright-langserver.js.map +1 -1
- package/dist/pyright.js +1 -1
- package/dist/pyright.js.map +1 -1
- package/dist/typeshed-fallback/commit.txt +1 -1
- package/dist/typeshed-fallback/stdlib/VERSIONS +9 -0
- package/dist/typeshed-fallback/stdlib/__future__.pyi +36 -36
- package/dist/typeshed-fallback/stdlib/__main__.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/_ast.pyi +149 -149
- package/dist/typeshed-fallback/stdlib/_asyncio.pyi +320 -342
- package/dist/typeshed-fallback/stdlib/_bisect.pyi +189 -229
- package/dist/typeshed-fallback/stdlib/_blake2.pyi +137 -137
- package/dist/typeshed-fallback/stdlib/_bootlocale.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/_bz2.pyi +71 -71
- package/dist/typeshed-fallback/stdlib/_codecs.pyi +247 -244
- package/dist/typeshed-fallback/stdlib/_collections_abc.pyi +124 -115
- package/dist/typeshed-fallback/stdlib/_compat_pickle.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/_compression.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/_contextvars.pyi +146 -146
- package/dist/typeshed-fallback/stdlib/_csv.pyi +232 -172
- package/dist/typeshed-fallback/stdlib/_ctypes.pyi +435 -304
- package/dist/typeshed-fallback/stdlib/_curses.pyi +2 -6
- package/dist/typeshed-fallback/stdlib/_curses_panel.pyi +67 -0
- package/dist/typeshed-fallback/stdlib/_dbm.pyi +8 -19
- package/dist/typeshed-fallback/stdlib/_decimal.pyi +80 -94
- package/dist/typeshed-fallback/stdlib/_dummy_thread.pyi +33 -33
- package/dist/typeshed-fallback/stdlib/_dummy_threading.pyi +164 -180
- package/dist/typeshed-fallback/stdlib/_frozen_importlib.pyi +114 -114
- package/dist/typeshed-fallback/stdlib/_frozen_importlib_external.pyi +178 -178
- package/dist/typeshed-fallback/stdlib/_gdbm.pyi +2 -65
- package/dist/typeshed-fallback/stdlib/_hashlib.pyi +232 -0
- package/dist/typeshed-fallback/stdlib/_heapq.pyi +67 -67
- package/dist/typeshed-fallback/stdlib/_imp.pyi +81 -83
- package/dist/typeshed-fallback/stdlib/_io.pyi +719 -719
- package/dist/typeshed-fallback/stdlib/_json.pyi +99 -92
- package/dist/typeshed-fallback/stdlib/_locale.pyi +155 -155
- package/dist/typeshed-fallback/stdlib/_lsprof.pyi +94 -94
- package/dist/typeshed-fallback/stdlib/_lzma.pyi +158 -158
- package/dist/typeshed-fallback/stdlib/_markupbase.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/_msi.pyi +92 -94
- package/dist/typeshed-fallback/stdlib/_multibytecodec.pyi +44 -0
- package/dist/typeshed-fallback/stdlib/_operator.pyi +261 -261
- package/dist/typeshed-fallback/stdlib/_osx_support.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/_posixsubprocess.pyi +0 -1
- package/dist/typeshed-fallback/stdlib/_py_abc.pyi +14 -14
- package/dist/typeshed-fallback/stdlib/_pydecimal.pyi +43 -43
- package/dist/typeshed-fallback/stdlib/_queue.pyi +67 -67
- package/dist/typeshed-fallback/stdlib/_random.pyi +30 -30
- package/dist/typeshed-fallback/stdlib/_sitebuiltins.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/_socket.pyi +1367 -1317
- package/dist/typeshed-fallback/stdlib/_sqlite3.pyi +360 -402
- package/dist/typeshed-fallback/stdlib/_ssl.pyi +399 -406
- package/dist/typeshed-fallback/stdlib/_stat.pyi +257 -257
- package/dist/typeshed-fallback/stdlib/_struct.pyi +147 -147
- package/dist/typeshed-fallback/stdlib/_thread.pyi +266 -257
- package/dist/typeshed-fallback/stdlib/_threading_local.pyi +22 -18
- package/dist/typeshed-fallback/stdlib/_tkinter.pyi +165 -165
- package/dist/typeshed-fallback/stdlib/_tracemalloc.pyi +78 -78
- package/dist/typeshed-fallback/stdlib/_warnings.pyi +98 -102
- package/dist/typeshed-fallback/stdlib/_weakref.pyi +35 -35
- package/dist/typeshed-fallback/stdlib/_weakrefset.pyi +57 -57
- package/dist/typeshed-fallback/stdlib/abc.pyi +59 -59
- package/dist/typeshed-fallback/stdlib/argparse.pyi +769 -769
- package/dist/typeshed-fallback/stdlib/array.pyi +267 -281
- package/dist/typeshed-fallback/stdlib/ast.pyi +2049 -2049
- package/dist/typeshed-fallback/stdlib/asynchat.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/asyncio/__init__.pyi +41 -41
- package/dist/typeshed-fallback/stdlib/asyncio/base_events.pyi +488 -488
- package/dist/typeshed-fallback/stdlib/asyncio/base_futures.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/asyncio/base_subprocess.pyi +63 -63
- package/dist/typeshed-fallback/stdlib/asyncio/base_tasks.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/asyncio/constants.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/asyncio/coroutines.pyi +26 -26
- package/dist/typeshed-fallback/stdlib/asyncio/events.pyi +653 -653
- package/dist/typeshed-fallback/stdlib/asyncio/exceptions.pyi +43 -43
- package/dist/typeshed-fallback/stdlib/asyncio/format_helpers.pyi +31 -31
- package/dist/typeshed-fallback/stdlib/asyncio/futures.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/asyncio/locks.pyi +127 -127
- package/dist/typeshed-fallback/stdlib/asyncio/log.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/asyncio/mixins.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/asyncio/proactor_events.pyi +64 -64
- package/dist/typeshed-fallback/stdlib/asyncio/protocols.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/asyncio/queues.pyi +64 -64
- package/dist/typeshed-fallback/stdlib/asyncio/runners.pyi +32 -32
- package/dist/typeshed-fallback/stdlib/asyncio/selector_events.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/asyncio/sslproto.pyi +165 -184
- package/dist/typeshed-fallback/stdlib/asyncio/staggered.pyi +10 -10
- package/dist/typeshed-fallback/stdlib/asyncio/streams.pyi +157 -157
- package/dist/typeshed-fallback/stdlib/asyncio/subprocess.pyi +229 -229
- package/dist/typeshed-fallback/stdlib/asyncio/taskgroups.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/asyncio/tasks.pyi +459 -459
- package/dist/typeshed-fallback/stdlib/asyncio/threads.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/asyncio/timeouts.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/asyncio/transports.pyi +47 -47
- package/dist/typeshed-fallback/stdlib/asyncio/trsock.pyi +94 -94
- package/dist/typeshed-fallback/stdlib/asyncore.pyi +90 -90
- package/dist/typeshed-fallback/stdlib/atexit.pyi +46 -46
- package/dist/typeshed-fallback/stdlib/audioop.pyi +26 -78
- package/dist/typeshed-fallback/stdlib/base64.pyi +65 -65
- package/dist/typeshed-fallback/stdlib/bdb.pyi +114 -114
- package/dist/typeshed-fallback/stdlib/binascii.pyi +113 -123
- package/dist/typeshed-fallback/stdlib/binhex.pyi +45 -45
- package/dist/typeshed-fallback/stdlib/bisect.pyi +4 -4
- package/dist/typeshed-fallback/stdlib/builtins.pyi +6481 -6560
- package/dist/typeshed-fallback/stdlib/bz2.pyi +132 -131
- package/dist/typeshed-fallback/stdlib/cProfile.pyi +31 -31
- package/dist/typeshed-fallback/stdlib/calendar.pyi +208 -208
- package/dist/typeshed-fallback/stdlib/cmath.pyi +112 -112
- package/dist/typeshed-fallback/stdlib/cmd.pyi +46 -46
- package/dist/typeshed-fallback/stdlib/code.pyi +56 -56
- package/dist/typeshed-fallback/stdlib/codecs.pyi +301 -297
- package/dist/typeshed-fallback/stdlib/codeop.pyi +13 -13
- package/dist/typeshed-fallback/stdlib/collections/__init__.pyi +650 -650
- package/dist/typeshed-fallback/stdlib/collections/abc.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/colorsys.pyi +13 -13
- package/dist/typeshed-fallback/stdlib/compileall.pyi +111 -111
- package/dist/typeshed-fallback/stdlib/concurrent/futures/__init__.pyi +51 -51
- package/dist/typeshed-fallback/stdlib/concurrent/futures/_base.pyi +132 -132
- package/dist/typeshed-fallback/stdlib/concurrent/futures/process.pyi +234 -234
- package/dist/typeshed-fallback/stdlib/concurrent/futures/thread.pyi +86 -86
- package/dist/typeshed-fallback/stdlib/configparser.pyi +412 -404
- package/dist/typeshed-fallback/stdlib/contextlib.pyi +219 -213
- package/dist/typeshed-fallback/stdlib/contextvars.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/copy.pyi +27 -27
- package/dist/typeshed-fallback/stdlib/copyreg.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/crypt.pyi +9 -2
- package/dist/typeshed-fallback/stdlib/csv.pyi +169 -167
- package/dist/typeshed-fallback/stdlib/ctypes/__init__.pyi +218 -198
- package/dist/typeshed-fallback/stdlib/ctypes/_endian.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/ctypes/macholib/__init__.pyi +1 -0
- package/dist/typeshed-fallback/stdlib/ctypes/macholib/dyld.pyi +8 -0
- package/dist/typeshed-fallback/stdlib/ctypes/macholib/dylib.pyi +14 -0
- package/dist/typeshed-fallback/stdlib/ctypes/macholib/framework.pyi +14 -0
- package/dist/typeshed-fallback/stdlib/ctypes/util.pyi +8 -6
- package/dist/typeshed-fallback/stdlib/ctypes/wintypes.pyi +304 -298
- package/dist/typeshed-fallback/stdlib/curses/__init__.pyi +19 -1
- package/dist/typeshed-fallback/stdlib/curses/panel.pyi +1 -34
- package/dist/typeshed-fallback/stdlib/dataclasses.pyi +322 -322
- package/dist/typeshed-fallback/stdlib/datetime.pyi +576 -575
- package/dist/typeshed-fallback/stdlib/dbm/__init__.pyi +104 -102
- package/dist/typeshed-fallback/stdlib/dbm/dumb.pyi +37 -37
- package/dist/typeshed-fallback/stdlib/decimal.pyi +849 -840
- package/dist/typeshed-fallback/stdlib/difflib.pyi +146 -146
- package/dist/typeshed-fallback/stdlib/dis.pyi +248 -248
- package/dist/typeshed-fallback/stdlib/distutils/__init__.pyi +5 -5
- package/dist/typeshed-fallback/stdlib/distutils/_msvccompiler.pyi +13 -13
- package/dist/typeshed-fallback/stdlib/distutils/archive_util.pyi +35 -35
- package/dist/typeshed-fallback/stdlib/distutils/bcppcompiler.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/ccompiler.pyi +176 -176
- package/dist/typeshed-fallback/stdlib/distutils/cmd.pyi +229 -229
- package/dist/typeshed-fallback/stdlib/distutils/command/__init__.pyi +48 -48
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist.pyi +27 -27
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_dumb.pyi +22 -22
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_msi.pyi +46 -46
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_rpm.pyi +53 -53
- package/dist/typeshed-fallback/stdlib/distutils/command/bdist_wininst.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/distutils/command/build.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/distutils/command/build_clib.pyi +29 -29
- package/dist/typeshed-fallback/stdlib/distutils/command/build_ext.pyi +52 -52
- package/dist/typeshed-fallback/stdlib/distutils/command/build_py.pyi +45 -45
- package/dist/typeshed-fallback/stdlib/distutils/command/build_scripts.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/distutils/command/check.pyi +40 -40
- package/dist/typeshed-fallback/stdlib/distutils/command/clean.pyi +18 -18
- package/dist/typeshed-fallback/stdlib/distutils/command/config.pyi +84 -84
- package/dist/typeshed-fallback/stdlib/distutils/command/install.pyi +71 -71
- package/dist/typeshed-fallback/stdlib/distutils/command/install_data.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/distutils/command/install_egg_info.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/distutils/command/install_headers.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/distutils/command/install_lib.pyi +26 -26
- package/dist/typeshed-fallback/stdlib/distutils/command/install_scripts.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/distutils/command/register.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/distutils/command/sdist.pyi +45 -45
- package/dist/typeshed-fallback/stdlib/distutils/command/upload.pyi +18 -18
- package/dist/typeshed-fallback/stdlib/distutils/config.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/distutils/core.pyi +58 -58
- package/dist/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/distutils/debug.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/dep_util.pyi +14 -14
- package/dist/typeshed-fallback/stdlib/distutils/dir_util.pyi +23 -23
- package/dist/typeshed-fallback/stdlib/distutils/dist.pyi +317 -317
- package/dist/typeshed-fallback/stdlib/distutils/errors.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/distutils/extension.pyi +36 -36
- package/dist/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/distutils/file_util.pyi +38 -38
- package/dist/typeshed-fallback/stdlib/distutils/filelist.pyi +58 -58
- package/dist/typeshed-fallback/stdlib/distutils/log.pyi +26 -26
- package/dist/typeshed-fallback/stdlib/distutils/msvccompiler.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/spawn.pyi +10 -6
- package/dist/typeshed-fallback/stdlib/distutils/sysconfig.pyi +33 -33
- package/dist/typeshed-fallback/stdlib/distutils/text_file.pyi +21 -21
- package/dist/typeshed-fallback/stdlib/distutils/unixccompiler.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/util.pyi +53 -53
- package/dist/typeshed-fallback/stdlib/distutils/version.pyi +36 -38
- package/dist/typeshed-fallback/stdlib/doctest.pyi +262 -264
- package/dist/typeshed-fallback/stdlib/dummy_threading.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/email/__init__.pyi +37 -29
- package/dist/typeshed-fallback/stdlib/email/_header_value_parser.pyi +398 -398
- package/dist/typeshed-fallback/stdlib/email/_policybase.pyi +77 -75
- package/dist/typeshed-fallback/stdlib/email/base64mime.pyi +13 -13
- package/dist/typeshed-fallback/stdlib/email/charset.pyi +36 -36
- package/dist/typeshed-fallback/stdlib/email/contentmanager.pyi +11 -11
- package/dist/typeshed-fallback/stdlib/email/encoders.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/email/errors.pyi +42 -42
- package/dist/typeshed-fallback/stdlib/email/feedparser.pyi +23 -23
- package/dist/typeshed-fallback/stdlib/email/generator.pyi +77 -77
- package/dist/typeshed-fallback/stdlib/email/header.pyi +33 -33
- package/dist/typeshed-fallback/stdlib/email/headerregistry.pyi +183 -183
- package/dist/typeshed-fallback/stdlib/email/iterators.pyi +12 -12
- package/dist/typeshed-fallback/stdlib/email/message.pyi +172 -172
- package/dist/typeshed-fallback/stdlib/email/mime/application.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/email/mime/audio.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/email/mime/base.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/email/mime/image.pyi +17 -17
- package/dist/typeshed-fallback/stdlib/email/mime/message.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/email/mime/multipart.pyi +18 -18
- package/dist/typeshed-fallback/stdlib/email/mime/nonmultipart.pyi +5 -5
- package/dist/typeshed-fallback/stdlib/email/mime/text.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/email/parser.pyi +38 -38
- package/dist/typeshed-fallback/stdlib/email/policy.pyi +77 -77
- package/dist/typeshed-fallback/stdlib/email/quoprimime.pyi +28 -28
- package/dist/typeshed-fallback/stdlib/email/utils.pyi +78 -78
- package/dist/typeshed-fallback/stdlib/encodings/__init__.pyi +10 -10
- package/dist/typeshed-fallback/stdlib/encodings/aliases.pyi +1 -0
- package/dist/typeshed-fallback/stdlib/encodings/ascii.pyi +30 -0
- package/dist/typeshed-fallback/stdlib/encodings/base64_codec.pyi +26 -0
- package/dist/typeshed-fallback/stdlib/encodings/big5.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/big5hkscs.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/bz2_codec.pyi +26 -0
- package/dist/typeshed-fallback/stdlib/encodings/charmap.pyi +33 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp037.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1006.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1026.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1125.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1140.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1250.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1251.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1252.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1253.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1254.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1255.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1256.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1257.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp1258.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp273.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp424.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp437.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp500.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp720.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp737.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp775.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp850.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp852.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp855.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp856.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp857.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp858.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp860.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp861.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp862.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp863.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp864.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp865.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp866.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp869.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp874.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp875.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp932.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp949.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/cp950.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/euc_jis_2004.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/euc_jisx0213.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/euc_jp.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/euc_kr.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/gb18030.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/gb2312.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/gbk.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/hex_codec.pyi +26 -0
- package/dist/typeshed-fallback/stdlib/encodings/hp_roman8.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/hz.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/idna.pyi +26 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso2022_jp.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso2022_jp_1.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso2022_jp_2.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso2022_jp_2004.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso2022_jp_3.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso2022_jp_ext.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso2022_kr.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_1.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_10.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_11.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_13.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_14.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_15.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_16.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_2.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_3.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_4.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_5.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_6.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_7.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_8.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/iso8859_9.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/johab.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/koi8_r.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/koi8_t.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/koi8_u.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/kz1048.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/latin_1.pyi +30 -0
- package/dist/typeshed-fallback/stdlib/encodings/mac_arabic.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/mac_centeuro.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/mac_croatian.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/mac_cyrillic.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/mac_farsi.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/mac_greek.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/mac_iceland.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/mac_latin2.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/mac_roman.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/mac_romanian.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/mac_turkish.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/mbcs.pyi +28 -0
- package/dist/typeshed-fallback/stdlib/encodings/oem.pyi +28 -0
- package/dist/typeshed-fallback/stdlib/encodings/palmos.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/ptcp154.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/punycode.pyi +33 -0
- package/dist/typeshed-fallback/stdlib/encodings/quopri_codec.pyi +26 -0
- package/dist/typeshed-fallback/stdlib/encodings/raw_unicode_escape.pyi +34 -0
- package/dist/typeshed-fallback/stdlib/encodings/rot_13.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/shift_jis.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/shift_jis_2004.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/shift_jisx0213.pyi +23 -0
- package/dist/typeshed-fallback/stdlib/encodings/tis_620.pyi +21 -0
- package/dist/typeshed-fallback/stdlib/encodings/undefined.pyi +20 -0
- package/dist/typeshed-fallback/stdlib/encodings/unicode_escape.pyi +34 -0
- package/dist/typeshed-fallback/stdlib/encodings/utf_16.pyi +20 -0
- package/dist/typeshed-fallback/stdlib/encodings/utf_16_be.pyi +26 -0
- package/dist/typeshed-fallback/stdlib/encodings/utf_16_le.pyi +26 -0
- package/dist/typeshed-fallback/stdlib/encodings/utf_32.pyi +20 -0
- package/dist/typeshed-fallback/stdlib/encodings/utf_32_be.pyi +26 -0
- package/dist/typeshed-fallback/stdlib/encodings/utf_32_le.pyi +26 -0
- package/dist/typeshed-fallback/stdlib/encodings/utf_7.pyi +26 -0
- package/dist/typeshed-fallback/stdlib/encodings/utf_8.pyi +26 -21
- package/dist/typeshed-fallback/stdlib/encodings/utf_8_sig.pyi +22 -22
- package/dist/typeshed-fallback/stdlib/encodings/uu_codec.pyi +28 -0
- package/dist/typeshed-fallback/stdlib/encodings/zlib_codec.pyi +26 -0
- package/dist/typeshed-fallback/stdlib/ensurepip/__init__.pyi +12 -12
- package/dist/typeshed-fallback/stdlib/enum.pyi +348 -348
- package/dist/typeshed-fallback/stdlib/errno.pyi +237 -237
- package/dist/typeshed-fallback/stdlib/faulthandler.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/fcntl.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/filecmp.pyi +74 -74
- package/dist/typeshed-fallback/stdlib/fileinput.pyi +219 -219
- package/dist/typeshed-fallback/stdlib/fnmatch.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/formatter.pyi +88 -88
- package/dist/typeshed-fallback/stdlib/fractions.pyi +162 -162
- package/dist/typeshed-fallback/stdlib/ftplib.pyi +178 -178
- package/dist/typeshed-fallback/stdlib/functools.pyi +270 -270
- package/dist/typeshed-fallback/stdlib/gc.pyi +144 -144
- package/dist/typeshed-fallback/stdlib/genericpath.pyi +59 -59
- package/dist/typeshed-fallback/stdlib/getopt.pyi +15 -15
- package/dist/typeshed-fallback/stdlib/getpass.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/gettext.pyi +171 -169
- package/dist/typeshed-fallback/stdlib/glob.pyi +50 -50
- package/dist/typeshed-fallback/stdlib/graphlib.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/gzip.pyi +162 -162
- package/dist/typeshed-fallback/stdlib/hashlib.pyi +104 -163
- package/dist/typeshed-fallback/stdlib/heapq.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/hmac.pyi +42 -65
- package/dist/typeshed-fallback/stdlib/html/__init__.pyi +6 -6
- package/dist/typeshed-fallback/stdlib/html/entities.pyi +6 -6
- package/dist/typeshed-fallback/stdlib/html/parser.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/http/__init__.pyi +112 -112
- package/dist/typeshed-fallback/stdlib/http/client.pyi +246 -246
- package/dist/typeshed-fallback/stdlib/http/cookiejar.pyi +159 -159
- package/dist/typeshed-fallback/stdlib/http/cookies.pyi +66 -66
- package/dist/typeshed-fallback/stdlib/http/server.pyi +83 -83
- package/dist/typeshed-fallback/stdlib/imaplib.pyi +168 -168
- package/dist/typeshed-fallback/stdlib/imp.pyi +62 -62
- package/dist/typeshed-fallback/stdlib/importlib/__init__.pyi +15 -15
- package/dist/typeshed-fallback/stdlib/importlib/_abc.pyi +15 -15
- package/dist/typeshed-fallback/stdlib/importlib/_bootstrap.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/importlib/_bootstrap_external.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/importlib/abc.pyi +175 -175
- package/dist/typeshed-fallback/stdlib/importlib/machinery.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi +342 -371
- package/dist/typeshed-fallback/stdlib/importlib/metadata/_meta.pyi +65 -65
- package/dist/typeshed-fallback/stdlib/importlib/readers.pyi +68 -68
- package/dist/typeshed-fallback/stdlib/importlib/resources/__init__.pyi +70 -70
- package/dist/typeshed-fallback/stdlib/importlib/resources/_common.pyi +42 -42
- package/dist/typeshed-fallback/stdlib/importlib/resources/abc.pyi +14 -12
- package/dist/typeshed-fallback/stdlib/importlib/resources/readers.pyi +14 -14
- package/dist/typeshed-fallback/stdlib/importlib/resources/simple.pyi +58 -58
- package/dist/typeshed-fallback/stdlib/importlib/simple.pyi +11 -11
- package/dist/typeshed-fallback/stdlib/importlib/util.pyi +33 -33
- package/dist/typeshed-fallback/stdlib/inspect.pyi +642 -642
- package/dist/typeshed-fallback/stdlib/io.pyi +60 -60
- package/dist/typeshed-fallback/stdlib/ipaddress.pyi +509 -355
- package/dist/typeshed-fallback/stdlib/itertools.pyi +574 -574
- package/dist/typeshed-fallback/stdlib/json/__init__.pyi +61 -61
- package/dist/typeshed-fallback/stdlib/json/decoder.pyi +32 -32
- package/dist/typeshed-fallback/stdlib/json/encoder.pyi +52 -52
- package/dist/typeshed-fallback/stdlib/json/scanner.pyi +3 -0
- package/dist/typeshed-fallback/stdlib/json/tool.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/keyword.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/lib2to3/pytree.pyi +2 -12
- package/dist/typeshed-fallback/stdlib/linecache.pyi +23 -23
- package/dist/typeshed-fallback/stdlib/locale.pyi +156 -156
- package/dist/typeshed-fallback/stdlib/logging/__init__.pyi +698 -698
- package/dist/typeshed-fallback/stdlib/logging/config.pyi +134 -134
- package/dist/typeshed-fallback/stdlib/logging/handlers.pyi +277 -277
- package/dist/typeshed-fallback/stdlib/lzma.pyi +174 -174
- package/dist/typeshed-fallback/stdlib/mailbox.pyi +276 -276
- package/dist/typeshed-fallback/stdlib/marshal.pyi +128 -176
- package/dist/typeshed-fallback/stdlib/math.pyi +438 -442
- package/dist/typeshed-fallback/stdlib/mimetypes.pyi +56 -56
- package/dist/typeshed-fallback/stdlib/mmap.pyi +185 -185
- package/dist/typeshed-fallback/stdlib/modulefinder.pyi +68 -66
- package/dist/typeshed-fallback/stdlib/msilib/__init__.pyi +177 -177
- package/dist/typeshed-fallback/stdlib/msilib/schema.pyi +94 -94
- package/dist/typeshed-fallback/stdlib/msilib/sequence.pyi +13 -13
- package/dist/typeshed-fallback/stdlib/msilib/text.pyi +7 -7
- package/dist/typeshed-fallback/stdlib/multiprocessing/__init__.pyi +90 -90
- package/dist/typeshed-fallback/stdlib/multiprocessing/connection.pyi +89 -89
- package/dist/typeshed-fallback/stdlib/multiprocessing/context.pyi +216 -215
- package/dist/typeshed-fallback/stdlib/multiprocessing/dummy/__init__.pyi +79 -79
- package/dist/typeshed-fallback/stdlib/multiprocessing/dummy/connection.pyi +39 -39
- package/dist/typeshed-fallback/stdlib/multiprocessing/forkserver.pyi +31 -31
- package/dist/typeshed-fallback/stdlib/multiprocessing/heap.pyi +36 -36
- package/dist/typeshed-fallback/stdlib/multiprocessing/managers.pyi +266 -266
- package/dist/typeshed-fallback/stdlib/multiprocessing/pool.pyi +109 -109
- package/dist/typeshed-fallback/stdlib/multiprocessing/process.pyi +50 -50
- package/dist/typeshed-fallback/stdlib/multiprocessing/queues.pyi +53 -53
- package/dist/typeshed-fallback/stdlib/multiprocessing/reduction.pyi +87 -87
- package/dist/typeshed-fallback/stdlib/multiprocessing/resource_sharer.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/multiprocessing/resource_tracker.pyi +18 -18
- package/dist/typeshed-fallback/stdlib/multiprocessing/shared_memory.pyi +58 -58
- package/dist/typeshed-fallback/stdlib/multiprocessing/sharedctypes.pyi +129 -128
- package/dist/typeshed-fallback/stdlib/multiprocessing/spawn.pyi +32 -32
- package/dist/typeshed-fallback/stdlib/multiprocessing/synchronize.pyi +59 -55
- package/dist/typeshed-fallback/stdlib/multiprocessing/util.pyi +98 -98
- package/dist/typeshed-fallback/stdlib/netrc.pyi +23 -23
- package/dist/typeshed-fallback/stdlib/nis.pyi +4 -31
- package/dist/typeshed-fallback/stdlib/ntpath.pyi +126 -126
- package/dist/typeshed-fallback/stdlib/nturl2path.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/numbers.pyi +229 -229
- package/dist/typeshed-fallback/stdlib/opcode.pyi +65 -65
- package/dist/typeshed-fallback/stdlib/operator.pyi +221 -221
- package/dist/typeshed-fallback/stdlib/optparse.pyi +257 -257
- package/dist/typeshed-fallback/stdlib/os/__init__.pyi +2946 -2491
- package/dist/typeshed-fallback/stdlib/os/path.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/parser.pyi +24 -55
- package/dist/typeshed-fallback/stdlib/pathlib.pyi +329 -329
- package/dist/typeshed-fallback/stdlib/pdb.pyi +206 -206
- package/dist/typeshed-fallback/stdlib/pickle.pyi +459 -459
- package/dist/typeshed-fallback/stdlib/pickletools.pyi +167 -167
- package/dist/typeshed-fallback/stdlib/pkgutil.pyi +53 -53
- package/dist/typeshed-fallback/stdlib/platform.pyi +97 -67
- package/dist/typeshed-fallback/stdlib/plistlib.pyi +113 -113
- package/dist/typeshed-fallback/stdlib/poplib.pyi +72 -72
- package/dist/typeshed-fallback/stdlib/posix.pyi +30 -10
- package/dist/typeshed-fallback/stdlib/posixpath.pyi +182 -182
- package/dist/typeshed-fallback/stdlib/pprint.pyi +112 -112
- package/dist/typeshed-fallback/stdlib/profile.pyi +31 -31
- package/dist/typeshed-fallback/stdlib/pstats.pyi +98 -80
- package/dist/typeshed-fallback/stdlib/py_compile.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/pyclbr.pyi +74 -74
- package/dist/typeshed-fallback/stdlib/pydoc.pyi +333 -333
- package/dist/typeshed-fallback/stdlib/pydoc_data/topics.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +131 -129
- package/dist/typeshed-fallback/stdlib/pyexpat/errors.pyi +53 -53
- package/dist/typeshed-fallback/stdlib/pyexpat/model.pyi +15 -15
- package/dist/typeshed-fallback/stdlib/queue.pyi +63 -63
- package/dist/typeshed-fallback/stdlib/quopri.pyi +11 -11
- package/dist/typeshed-fallback/stdlib/random.pyi +141 -141
- package/dist/typeshed-fallback/stdlib/re.pyi +476 -476
- package/dist/typeshed-fallback/stdlib/readline.pyi +1 -7
- package/dist/typeshed-fallback/stdlib/reprlib.pyi +65 -65
- package/dist/typeshed-fallback/stdlib/rlcompleter.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/runpy.pyi +24 -24
- package/dist/typeshed-fallback/stdlib/sched.pyi +52 -49
- package/dist/typeshed-fallback/stdlib/secrets.pyi +15 -15
- package/dist/typeshed-fallback/stdlib/select.pyi +247 -247
- package/dist/typeshed-fallback/stdlib/selectors.pyi +67 -67
- package/dist/typeshed-fallback/stdlib/shelve.pyi +59 -59
- package/dist/typeshed-fallback/stdlib/shlex.pyi +63 -63
- package/dist/typeshed-fallback/stdlib/shutil.pyi +230 -230
- package/dist/typeshed-fallback/stdlib/signal.pyi +263 -263
- package/dist/typeshed-fallback/stdlib/site.pyi +36 -36
- package/dist/typeshed-fallback/stdlib/smtpd.pyi +91 -91
- package/dist/typeshed-fallback/stdlib/smtplib.pyi +204 -204
- package/dist/typeshed-fallback/stdlib/socket.pyi +1413 -856
- package/dist/typeshed-fallback/stdlib/socketserver.pyi +169 -169
- package/dist/typeshed-fallback/stdlib/spwd.pyi +13 -66
- package/dist/typeshed-fallback/stdlib/sqlite3/__init__.pyi +785 -787
- package/dist/typeshed-fallback/stdlib/sqlite3/dbapi2.pyi +241 -241
- package/dist/typeshed-fallback/stdlib/sqlite3/dump.pyi +2 -0
- package/dist/typeshed-fallback/stdlib/sre_compile.pyi +11 -11
- package/dist/typeshed-fallback/stdlib/sre_constants.pyi +124 -124
- package/dist/typeshed-fallback/stdlib/sre_parse.pyi +104 -104
- package/dist/typeshed-fallback/stdlib/ssl.pyi +558 -560
- package/dist/typeshed-fallback/stdlib/stat.pyi +7 -7
- package/dist/typeshed-fallback/stdlib/statistics.pyi +176 -176
- package/dist/typeshed-fallback/stdlib/string.pyi +83 -83
- package/dist/typeshed-fallback/stdlib/stringprep.pyi +27 -27
- package/dist/typeshed-fallback/stdlib/struct.pyi +5 -5
- package/dist/typeshed-fallback/stdlib/subprocess.pyi +2640 -2640
- package/dist/typeshed-fallback/stdlib/symbol.pyi +93 -93
- package/dist/typeshed-fallback/stdlib/symtable.pyi +90 -90
- package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +773 -707
- package/dist/typeshed-fallback/stdlib/sysconfig.pyi +48 -48
- package/dist/typeshed-fallback/stdlib/tabnanny.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/tarfile.pyi +593 -593
- package/dist/typeshed-fallback/stdlib/tempfile.pyi +497 -497
- package/dist/typeshed-fallback/stdlib/termios.pyi +108 -72
- package/dist/typeshed-fallback/stdlib/textwrap.pyi +103 -103
- package/dist/typeshed-fallback/stdlib/threading.pyi +279 -279
- package/dist/typeshed-fallback/stdlib/time.pyi +380 -380
- package/dist/typeshed-fallback/stdlib/timeit.pyi +32 -32
- package/dist/typeshed-fallback/stdlib/tkinter/__init__.pyi +3900 -3847
- package/dist/typeshed-fallback/stdlib/tkinter/colorchooser.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/tkinter/commondialog.pyi +14 -14
- package/dist/typeshed-fallback/stdlib/tkinter/constants.pyi +80 -80
- package/dist/typeshed-fallback/stdlib/tkinter/dialog.pyi +16 -16
- package/dist/typeshed-fallback/stdlib/tkinter/dnd.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/tkinter/filedialog.pyi +151 -151
- package/dist/typeshed-fallback/stdlib/tkinter/font.pyi +118 -116
- package/dist/typeshed-fallback/stdlib/tkinter/messagebox.pyi +44 -44
- package/dist/typeshed-fallback/stdlib/tkinter/scrolledtext.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/tkinter/simpledialog.pyi +54 -54
- package/dist/typeshed-fallback/stdlib/tkinter/ttk.pyi +1207 -1207
- package/dist/typeshed-fallback/stdlib/token.pyi +160 -160
- package/dist/typeshed-fallback/stdlib/tokenize.pyi +186 -184
- package/dist/typeshed-fallback/stdlib/tomllib.pyi +10 -10
- package/dist/typeshed-fallback/stdlib/trace.pyi +90 -90
- package/dist/typeshed-fallback/stdlib/traceback.pyi +300 -300
- package/dist/typeshed-fallback/stdlib/tracemalloc.pyi +124 -124
- package/dist/typeshed-fallback/stdlib/turtle.pyi +732 -721
- package/dist/typeshed-fallback/stdlib/types.pyi +909 -913
- package/dist/typeshed-fallback/stdlib/typing.pyi +1145 -1147
- package/dist/typeshed-fallback/stdlib/typing_extensions.pyi +19 -47
- package/dist/typeshed-fallback/stdlib/unicodedata.pyi +303 -303
- package/dist/typeshed-fallback/stdlib/unittest/__init__.pyi +63 -68
- package/dist/typeshed-fallback/stdlib/unittest/_log.pyi +27 -27
- package/dist/typeshed-fallback/stdlib/unittest/async_case.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/unittest/case.pyi +361 -361
- package/dist/typeshed-fallback/stdlib/unittest/loader.pyi +55 -55
- package/dist/typeshed-fallback/stdlib/unittest/main.pyi +73 -73
- package/dist/typeshed-fallback/stdlib/unittest/mock.pyi +468 -468
- package/dist/typeshed-fallback/stdlib/unittest/result.pyi +47 -47
- package/dist/typeshed-fallback/stdlib/unittest/runner.pyi +92 -92
- package/dist/typeshed-fallback/stdlib/unittest/signals.pyi +15 -15
- package/dist/typeshed-fallback/stdlib/unittest/suite.pyi +22 -22
- package/dist/typeshed-fallback/stdlib/unittest/util.pyi +23 -23
- package/dist/typeshed-fallback/stdlib/urllib/error.pyi +23 -23
- package/dist/typeshed-fallback/stdlib/urllib/parse.pyi +258 -258
- package/dist/typeshed-fallback/stdlib/urllib/request.pyi +408 -408
- package/dist/typeshed-fallback/stdlib/urllib/response.pyi +43 -43
- package/dist/typeshed-fallback/stdlib/urllib/robotparser.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/uuid.pyi +100 -100
- package/dist/typeshed-fallback/stdlib/venv/__init__.pyi +107 -107
- package/dist/typeshed-fallback/stdlib/warnings.pyi +127 -127
- package/dist/typeshed-fallback/stdlib/wave.pyi +85 -85
- package/dist/typeshed-fallback/stdlib/weakref.pyi +198 -198
- package/dist/typeshed-fallback/stdlib/webbrowser.pyi +78 -77
- package/dist/typeshed-fallback/stdlib/wsgiref/handlers.pyi +91 -91
- package/dist/typeshed-fallback/stdlib/wsgiref/headers.pyi +26 -26
- package/dist/typeshed-fallback/stdlib/wsgiref/simple_server.pyi +37 -37
- package/dist/typeshed-fallback/stdlib/wsgiref/types.pyi +32 -32
- package/dist/typeshed-fallback/stdlib/wsgiref/util.pyi +26 -26
- package/dist/typeshed-fallback/stdlib/wsgiref/validate.pyi +50 -50
- package/dist/typeshed-fallback/stdlib/xml/__init__.pyi +3 -1
- package/dist/typeshed-fallback/stdlib/xml/dom/NodeFilter.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/xml/dom/__init__.pyi +69 -69
- package/dist/typeshed-fallback/stdlib/xml/dom/domreg.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/xml/dom/expatbuilder.pyi +100 -100
- package/dist/typeshed-fallback/stdlib/xml/dom/minicompat.pyi +26 -26
- package/dist/typeshed-fallback/stdlib/xml/dom/minidom.pyi +426 -426
- package/dist/typeshed-fallback/stdlib/xml/dom/pulldom.pyi +94 -94
- package/dist/typeshed-fallback/stdlib/xml/dom/xmlbuilder.pyi +108 -108
- package/dist/typeshed-fallback/stdlib/xml/etree/ElementInclude.pyi +29 -29
- package/dist/typeshed-fallback/stdlib/xml/etree/ElementPath.pyi +34 -34
- package/dist/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi +347 -347
- package/dist/typeshed-fallback/stdlib/xml/etree/cElementTree.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/xml/parsers/__init__.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/xml/parsers/expat/__init__.pyi +7 -7
- package/dist/typeshed-fallback/stdlib/xml/parsers/expat/errors.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/xml/parsers/expat/model.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/xml/sax/__init__.pyi +25 -25
- package/dist/typeshed-fallback/stdlib/xml/sax/_exceptions.pyi +19 -19
- package/dist/typeshed-fallback/stdlib/xml/sax/handler.pyi +55 -55
- package/dist/typeshed-fallback/stdlib/xml/sax/saxutils.pyi +60 -60
- package/dist/typeshed-fallback/stdlib/xml/sax/xmlreader.pyi +87 -87
- package/dist/typeshed-fallback/stdlib/xmlrpc/client.pyi +296 -296
- package/dist/typeshed-fallback/stdlib/xmlrpc/server.pyi +144 -144
- package/dist/typeshed-fallback/stdlib/xxlimited.pyi +1 -3
- package/dist/typeshed-fallback/stdlib/zipapp.pyi +20 -20
- package/dist/typeshed-fallback/stdlib/zipfile/__init__.pyi +384 -384
- package/dist/typeshed-fallback/stdlib/zipfile/_path.pyi +103 -101
- package/dist/typeshed-fallback/stdlib/zipimport.pyi +41 -70
- package/dist/typeshed-fallback/stdlib/zlib.pyi +162 -157
- package/dist/typeshed-fallback/stdlib/zoneinfo/__init__.pyi +41 -47
- package/dist/typeshed-fallback/stdlib/zoneinfo/_common.pyi +13 -13
- package/dist/typeshed-fallback/stdlib/zoneinfo/_tzpath.pyi +13 -13
- package/dist/typeshed-fallback/stubs/Deprecated/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/Deprecated/deprecated/classic.pyi +6 -1
- package/dist/typeshed-fallback/stubs/Deprecated/deprecated/sphinx.pyi +1 -0
- package/dist/typeshed-fallback/stubs/bleach/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/docutils/docutils/core.pyi +216 -1
- package/dist/typeshed-fallback/stubs/docutils/docutils/writers/__init__.pyi +60 -2
- package/dist/typeshed-fallback/stubs/gevent/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/gevent/gevent/events.pyi +3 -1
- package/dist/typeshed-fallback/stubs/icalendar/METADATA.toml +6 -2
- package/dist/typeshed-fallback/stubs/icalendar/icalendar/__init__.pyi +14 -0
- package/dist/typeshed-fallback/stubs/icalendar/icalendar/alarms.pyi +54 -0
- package/dist/typeshed-fallback/stubs/icalendar/icalendar/cal.pyi +137 -11
- package/dist/typeshed-fallback/stubs/icalendar/icalendar/prop.pyi +8 -7
- package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/__init__.pyi +3 -2
- package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/equivalent_timezone_ids.pyi +15 -0
- package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/equivalent_timezone_ids_result.pyi +6 -0
- package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/tzid.pyi +8 -0
- package/dist/typeshed-fallback/stubs/icalendar/icalendar/timezone/tzp.pyi +2 -2
- package/dist/typeshed-fallback/stubs/icalendar/icalendar/tools.pyi +12 -1
- package/dist/typeshed-fallback/stubs/networkx/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/components/strongly_connected.pyi +0 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/branchings.pyi +0 -31
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/operations.pyi +1 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/classes/reportviews.pyi +3 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/drawing/layout.pyi +4 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/generators/trees.pyi +0 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/json_graph/node_link.pyi +12 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/readwrite/text.pyi +1 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/utils/configs.pyi +20 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/__init__.pyi +2 -1
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/cell/__init__.pyi +2 -0
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/cell/_writer.pyi +4 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/cell/cell.pyi +2 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi +2 -1
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/workbook.pyi +2 -2
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi +5 -14
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi +2 -3
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi +4 -3
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/merge.pyi +2 -1
- package/dist/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi +30 -19
- package/dist/typeshed-fallback/stubs/peewee/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/peewee/peewee.pyi +3 -1
- package/dist/typeshed-fallback/stubs/pynput/pynput/_util.pyi +2 -2
- package/dist/typeshed-fallback/stubs/pysftp/pysftp/__init__.pyi +2 -2
- package/dist/typeshed-fallback/stubs/pywin32/isapi/install.pyi +98 -0
- package/dist/typeshed-fallback/stubs/pywin32/win32/win32clipboard.pyi +26 -24
- package/dist/typeshed-fallback/stubs/setuptools/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/distutils/spawn.pyi +1 -0
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/__init__.pyi +6 -7
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/ccompiler.pyi +2 -2
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi +2 -2
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/spawn.pyi +7 -0
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/build_meta.pyi +4 -2
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_egg.pyi +9 -8
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_wheel.pyi +3 -5
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi +2 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi +6 -7
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi +12 -17
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/editable_wheel.pyi +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/install_egg_info.pyi +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/sdist.pyi +2 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi +2 -2
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/config/__init__.pyi +1 -14
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/config/expand.pyi +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/config/setupcfg.pyi +7 -5
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/depends.pyi +8 -4
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/msvc.pyi +7 -8
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/package_index.pyi +7 -3
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/sandbox.pyi +2 -4
- package/dist/typeshed-fallback/stubs/tqdm/METADATA.toml +2 -1
- package/dist/typeshed-fallback/stubs/tqdm/tqdm/contrib/discord.pyi +14 -3
- package/dist/typeshed-fallback/stubs/waitress/waitress/runner.pyi +1 -5
- package/package.json +5 -3
|
@@ -1,719 +1,719 @@
|
|
|
1
|
-
"""
|
|
2
|
-
The io module provides the Python interfaces to stream handling. The
|
|
3
|
-
builtin open function is defined in this module.
|
|
4
|
-
|
|
5
|
-
At the top of the I/O hierarchy is the abstract base class IOBase. It
|
|
6
|
-
defines the basic interface to a stream. Note, however, that there is no
|
|
7
|
-
separation between reading and writing to streams; implementations are
|
|
8
|
-
allowed to raise an OSError if they do not support a given operation.
|
|
9
|
-
|
|
10
|
-
Extending IOBase is RawIOBase which deals simply with the reading and
|
|
11
|
-
writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
|
|
12
|
-
an interface to OS files.
|
|
13
|
-
|
|
14
|
-
BufferedIOBase deals with buffering on a raw byte stream (RawIOBase). Its
|
|
15
|
-
subclasses, BufferedWriter, BufferedReader, and BufferedRWPair buffer
|
|
16
|
-
streams that are readable, writable, and both respectively.
|
|
17
|
-
BufferedRandom provides a buffered interface to random access
|
|
18
|
-
streams. BytesIO is a simple stream of in-memory bytes.
|
|
19
|
-
|
|
20
|
-
Another IOBase subclass, TextIOBase, deals with the encoding and decoding
|
|
21
|
-
of streams into text. TextIOWrapper, which extends it, is a buffered text
|
|
22
|
-
interface to a buffered raw stream (`BufferedIOBase`). Finally, StringIO
|
|
23
|
-
is an in-memory stream for text.
|
|
24
|
-
|
|
25
|
-
Argument names are not part of the specification, and only the arguments
|
|
26
|
-
of open() are intended to be used as keyword arguments.
|
|
27
|
-
|
|
28
|
-
data:
|
|
29
|
-
|
|
30
|
-
DEFAULT_BUFFER_SIZE
|
|
31
|
-
|
|
32
|
-
An int containing the default buffer size used by the module's buffered
|
|
33
|
-
I/O classes. open() uses the file's blksize (as obtained by os.stat) if
|
|
34
|
-
possible.
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
|
-
import builtins
|
|
38
|
-
import codecs
|
|
39
|
-
import sys
|
|
40
|
-
from _typeshed import FileDescriptorOrPath, MaybeNone, ReadableBuffer, WriteableBuffer
|
|
41
|
-
from collections.abc import Callable, Iterable, Iterator
|
|
42
|
-
from io import BufferedIOBase, RawIOBase, TextIOBase, UnsupportedOperation as UnsupportedOperation
|
|
43
|
-
from os import _Opener
|
|
44
|
-
from types import TracebackType
|
|
45
|
-
from typing import IO, Any, BinaryIO, Final, Generic, Literal, Protocol, TextIO, TypeVar, overload, type_check_only
|
|
46
|
-
from typing_extensions import Self
|
|
47
|
-
|
|
48
|
-
_T = TypeVar("_T")
|
|
49
|
-
|
|
50
|
-
DEFAULT_BUFFER_SIZE: Final = 8192
|
|
51
|
-
|
|
52
|
-
open = builtins.open
|
|
53
|
-
|
|
54
|
-
def open_code(path: str) -> IO[bytes]:
|
|
55
|
-
"""
|
|
56
|
-
Opens the provided file with the intent to import the contents.
|
|
57
|
-
|
|
58
|
-
This may perform extra validation beyond open(), but is otherwise interchangeable
|
|
59
|
-
with calling open(path, 'rb').
|
|
60
|
-
"""
|
|
61
|
-
...
|
|
62
|
-
|
|
63
|
-
BlockingIOError = builtins.BlockingIOError
|
|
64
|
-
|
|
65
|
-
class _IOBase:
|
|
66
|
-
"""
|
|
67
|
-
The abstract base class for all I/O classes.
|
|
68
|
-
|
|
69
|
-
This class provides dummy implementations for many methods that
|
|
70
|
-
derived classes can override selectively; the default implementations
|
|
71
|
-
represent a file that cannot be read, written or seeked.
|
|
72
|
-
|
|
73
|
-
Even though IOBase does not declare read, readinto, or write because
|
|
74
|
-
their signatures will vary, implementations and clients should
|
|
75
|
-
consider those methods part of the interface. Also, implementations
|
|
76
|
-
may raise UnsupportedOperation when operations they do not support are
|
|
77
|
-
called.
|
|
78
|
-
|
|
79
|
-
The basic type used for binary data read from or written to a file is
|
|
80
|
-
bytes. Other bytes-like objects are accepted as method arguments too.
|
|
81
|
-
In some cases (such as readinto), a writable object is required. Text
|
|
82
|
-
I/O classes work with str data.
|
|
83
|
-
|
|
84
|
-
Note that calling any method (except additional calls to close(),
|
|
85
|
-
which are ignored) on a closed stream should raise a ValueError.
|
|
86
|
-
|
|
87
|
-
IOBase (and its subclasses) support the iterator protocol, meaning
|
|
88
|
-
that an IOBase object can be iterated over yielding the lines in a
|
|
89
|
-
stream.
|
|
90
|
-
|
|
91
|
-
IOBase also supports the :keyword:`with` statement. In this example,
|
|
92
|
-
fp is closed after the suite of the with statement is complete:
|
|
93
|
-
|
|
94
|
-
with open('spam.txt', 'r') as fp:
|
|
95
|
-
fp.write('Spam and eggs!')
|
|
96
|
-
"""
|
|
97
|
-
def __iter__(self) -> Iterator[bytes]:
|
|
98
|
-
"""Implement iter(self)."""
|
|
99
|
-
...
|
|
100
|
-
def __next__(self) -> bytes:
|
|
101
|
-
"""Implement next(self)."""
|
|
102
|
-
...
|
|
103
|
-
def __enter__(self) -> Self: ...
|
|
104
|
-
def __exit__(
|
|
105
|
-
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
|
106
|
-
) -> None: ...
|
|
107
|
-
def close(self) -> None:
|
|
108
|
-
"""
|
|
109
|
-
Flush and close the IO object.
|
|
110
|
-
|
|
111
|
-
This method has no effect if the file is already closed.
|
|
112
|
-
"""
|
|
113
|
-
...
|
|
114
|
-
def fileno(self) -> int:
|
|
115
|
-
"""
|
|
116
|
-
Return underlying file descriptor if one exists.
|
|
117
|
-
|
|
118
|
-
Raise OSError if the IO object does not use a file descriptor.
|
|
119
|
-
"""
|
|
120
|
-
...
|
|
121
|
-
def flush(self) -> None:
|
|
122
|
-
"""
|
|
123
|
-
Flush write buffers, if applicable.
|
|
124
|
-
|
|
125
|
-
This is not implemented for read-only and non-blocking streams.
|
|
126
|
-
"""
|
|
127
|
-
...
|
|
128
|
-
def isatty(self) -> bool:
|
|
129
|
-
"""
|
|
130
|
-
Return whether this is an 'interactive' stream.
|
|
131
|
-
|
|
132
|
-
Return False if it can't be determined.
|
|
133
|
-
"""
|
|
134
|
-
...
|
|
135
|
-
def readable(self) -> bool:
|
|
136
|
-
"""
|
|
137
|
-
Return whether object was opened for reading.
|
|
138
|
-
|
|
139
|
-
If False, read() will raise OSError.
|
|
140
|
-
"""
|
|
141
|
-
...
|
|
142
|
-
read: Callable[..., Any]
|
|
143
|
-
def readlines(self, hint: int = -1, /) -> list[bytes]:
|
|
144
|
-
"""
|
|
145
|
-
Return a list of lines from the stream.
|
|
146
|
-
|
|
147
|
-
hint can be specified to control the number of lines read: no more
|
|
148
|
-
lines will be read if the total size (in bytes/characters) of all
|
|
149
|
-
lines so far exceeds hint.
|
|
150
|
-
"""
|
|
151
|
-
...
|
|
152
|
-
def seek(self, offset: int, whence: int = 0, /) -> int:
|
|
153
|
-
"""
|
|
154
|
-
Change the stream position to the given byte offset.
|
|
155
|
-
|
|
156
|
-
offset
|
|
157
|
-
The stream position, relative to 'whence'.
|
|
158
|
-
whence
|
|
159
|
-
The relative position to seek from.
|
|
160
|
-
|
|
161
|
-
The offset is interpreted relative to the position indicated by whence.
|
|
162
|
-
Values for whence are:
|
|
163
|
-
|
|
164
|
-
* os.SEEK_SET or 0 -- start of stream (the default); offset should be zero or positive
|
|
165
|
-
* os.SEEK_CUR or 1 -- current stream position; offset may be negative
|
|
166
|
-
* os.SEEK_END or 2 -- end of stream; offset is usually negative
|
|
167
|
-
|
|
168
|
-
Return the new absolute position.
|
|
169
|
-
"""
|
|
170
|
-
...
|
|
171
|
-
def seekable(self) -> bool:
|
|
172
|
-
"""
|
|
173
|
-
Return whether object supports random access.
|
|
174
|
-
|
|
175
|
-
If False, seek(), tell() and truncate() will raise OSError.
|
|
176
|
-
This method may need to do a test seek().
|
|
177
|
-
"""
|
|
178
|
-
...
|
|
179
|
-
def tell(self) -> int:
|
|
180
|
-
"""Return current stream position."""
|
|
181
|
-
...
|
|
182
|
-
def truncate(self, size: int | None = None, /) -> int:
|
|
183
|
-
"""
|
|
184
|
-
Truncate file to size bytes.
|
|
185
|
-
|
|
186
|
-
File pointer is left unchanged. Size defaults to the current IO position
|
|
187
|
-
as reported by tell(). Return the new size.
|
|
188
|
-
"""
|
|
189
|
-
...
|
|
190
|
-
def writable(self) -> bool:
|
|
191
|
-
"""
|
|
192
|
-
Return whether object was opened for writing.
|
|
193
|
-
|
|
194
|
-
If False, write() will raise OSError.
|
|
195
|
-
"""
|
|
196
|
-
...
|
|
197
|
-
write: Callable[..., Any]
|
|
198
|
-
def writelines(self, lines: Iterable[ReadableBuffer], /) -> None:
|
|
199
|
-
"""
|
|
200
|
-
Write a list of lines to stream.
|
|
201
|
-
|
|
202
|
-
Line separators are not added, so it is usual for each of the
|
|
203
|
-
lines provided to have a line separator at the end.
|
|
204
|
-
"""
|
|
205
|
-
...
|
|
206
|
-
def readline(self, size: int | None = -1, /) -> bytes:
|
|
207
|
-
r"""
|
|
208
|
-
Read and return a line from the stream.
|
|
209
|
-
|
|
210
|
-
If size is specified, at most size bytes will be read.
|
|
211
|
-
|
|
212
|
-
The line terminator is always b'\n' for binary files; for text
|
|
213
|
-
files, the newlines argument to open can be used to select the line
|
|
214
|
-
terminator(s) recognized.
|
|
215
|
-
"""
|
|
216
|
-
...
|
|
217
|
-
def __del__(self) -> None:
|
|
218
|
-
"""Called when the instance is about to be destroyed."""
|
|
219
|
-
...
|
|
220
|
-
@property
|
|
221
|
-
def closed(self) -> bool: ...
|
|
222
|
-
def _checkClosed(self) -> None: ... # undocumented
|
|
223
|
-
|
|
224
|
-
class _RawIOBase(_IOBase):
|
|
225
|
-
"""Base class for raw binary I/O."""
|
|
226
|
-
def readall(self) -> bytes:
|
|
227
|
-
"""Read until EOF, using multiple read() call."""
|
|
228
|
-
...
|
|
229
|
-
# The following methods can return None if the file is in non-blocking mode
|
|
230
|
-
# and no data is available.
|
|
231
|
-
def readinto(self, buffer: WriteableBuffer, /) -> int | MaybeNone: ...
|
|
232
|
-
def write(self, b: ReadableBuffer, /) -> int | MaybeNone: ...
|
|
233
|
-
def read(self, size: int = -1, /) -> bytes | MaybeNone: ...
|
|
234
|
-
|
|
235
|
-
class _BufferedIOBase(_IOBase):
|
|
236
|
-
"""
|
|
237
|
-
Base class for buffered IO objects.
|
|
238
|
-
|
|
239
|
-
The main difference with RawIOBase is that the read() method
|
|
240
|
-
supports omitting the size argument, and does not have a default
|
|
241
|
-
implementation that defers to readinto().
|
|
242
|
-
|
|
243
|
-
In addition, read(), readinto() and write() may raise
|
|
244
|
-
BlockingIOError if the underlying raw stream is in non-blocking
|
|
245
|
-
mode and not ready; unlike their raw counterparts, they will never
|
|
246
|
-
return None.
|
|
247
|
-
|
|
248
|
-
A typical implementation should not inherit from a RawIOBase
|
|
249
|
-
implementation, but wrap one.
|
|
250
|
-
"""
|
|
251
|
-
def detach(self) -> RawIOBase:
|
|
252
|
-
"""
|
|
253
|
-
Disconnect this buffer from its underlying raw stream and return it.
|
|
254
|
-
|
|
255
|
-
After the raw stream has been detached, the buffer is in an unusable
|
|
256
|
-
state.
|
|
257
|
-
"""
|
|
258
|
-
...
|
|
259
|
-
def readinto(self, buffer: WriteableBuffer, /) -> int: ...
|
|
260
|
-
def write(self, buffer: ReadableBuffer, /) -> int:
|
|
261
|
-
"""
|
|
262
|
-
Write buffer b to the IO stream.
|
|
263
|
-
|
|
264
|
-
Return the number of bytes written, which is always
|
|
265
|
-
the length of b in bytes.
|
|
266
|
-
|
|
267
|
-
Raise BlockingIOError if the buffer is full and the
|
|
268
|
-
underlying raw stream cannot accept more data at the moment.
|
|
269
|
-
"""
|
|
270
|
-
...
|
|
271
|
-
def readinto1(self, buffer: WriteableBuffer, /) -> int: ...
|
|
272
|
-
def read(self, size: int | None = -1, /) -> bytes:
|
|
273
|
-
"""
|
|
274
|
-
Read and return up to n bytes.
|
|
275
|
-
|
|
276
|
-
If the size argument is omitted, None, or negative, read and
|
|
277
|
-
return all data until EOF.
|
|
278
|
-
|
|
279
|
-
If the size argument is positive, and the underlying raw stream is
|
|
280
|
-
not 'interactive', multiple raw reads may be issued to satisfy
|
|
281
|
-
the byte count (unless EOF is reached first).
|
|
282
|
-
However, for interactive raw streams (as well as sockets and pipes),
|
|
283
|
-
at most one raw read will be issued, and a short result does not
|
|
284
|
-
imply that EOF is imminent.
|
|
285
|
-
|
|
286
|
-
Return an empty bytes object on EOF.
|
|
287
|
-
|
|
288
|
-
Return None if the underlying raw stream was open in non-blocking
|
|
289
|
-
mode and no data is available at the moment.
|
|
290
|
-
"""
|
|
291
|
-
...
|
|
292
|
-
def read1(self, size: int = -1, /) -> bytes:
|
|
293
|
-
"""
|
|
294
|
-
Read and return up to size bytes, with at most one read() call to the underlying raw stream.
|
|
295
|
-
|
|
296
|
-
Return an empty bytes object on EOF.
|
|
297
|
-
A short result does not imply that EOF is imminent.
|
|
298
|
-
"""
|
|
299
|
-
...
|
|
300
|
-
|
|
301
|
-
class FileIO(RawIOBase, _RawIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of writelines in the base classes
|
|
302
|
-
"""
|
|
303
|
-
Open a file.
|
|
304
|
-
|
|
305
|
-
The mode can be 'r' (default), 'w', 'x' or 'a' for reading,
|
|
306
|
-
writing, exclusive creation or appending. The file will be created if it
|
|
307
|
-
doesn't exist when opened for writing or appending; it will be truncated
|
|
308
|
-
when opened for writing. A FileExistsError will be raised if it already
|
|
309
|
-
exists when opened for creating. Opening a file for creating implies
|
|
310
|
-
writing so this mode behaves in a similar way to 'w'.Add a '+' to the mode
|
|
311
|
-
to allow simultaneous reading and writing. A custom opener can be used by
|
|
312
|
-
passing a callable as *opener*. The underlying file descriptor for the file
|
|
313
|
-
object is then obtained by calling opener with (*name*, *flags*).
|
|
314
|
-
*opener* must return an open file descriptor (passing os.open as *opener*
|
|
315
|
-
results in functionality similar to passing None).
|
|
316
|
-
"""
|
|
317
|
-
mode: str
|
|
318
|
-
# The type of "name" equals the argument passed in to the constructor,
|
|
319
|
-
# but that can make FileIO incompatible with other I/O types that assume
|
|
320
|
-
# "name" is a str. In the future, making FileIO generic might help.
|
|
321
|
-
name: Any
|
|
322
|
-
def __init__(
|
|
323
|
-
self, file: FileDescriptorOrPath, mode: str = "r", closefd: bool = True, opener: _Opener | None = None
|
|
324
|
-
) -> None: ...
|
|
325
|
-
@property
|
|
326
|
-
def closefd(self) -> bool:
|
|
327
|
-
"""True if the file descriptor will be closed by close()."""
|
|
328
|
-
...
|
|
329
|
-
def seek(self, pos: int, whence: int = 0, /) -> int:
|
|
330
|
-
"""
|
|
331
|
-
Move to new file position and return the file position.
|
|
332
|
-
|
|
333
|
-
Argument offset is a byte count. Optional argument whence defaults to
|
|
334
|
-
SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values
|
|
335
|
-
are SEEK_CUR or 1 (move relative to current position, positive or negative),
|
|
336
|
-
and SEEK_END or 2 (move relative to end of file, usually negative, although
|
|
337
|
-
many platforms allow seeking beyond the end of a file).
|
|
338
|
-
|
|
339
|
-
Note that not all file objects are seekable.
|
|
340
|
-
"""
|
|
341
|
-
...
|
|
342
|
-
def read(self, size: int | None = -1, /) -> bytes | MaybeNone:
|
|
343
|
-
"""
|
|
344
|
-
Read at most size bytes, returned as bytes.
|
|
345
|
-
|
|
346
|
-
Only makes one system call, so less data may be returned than requested.
|
|
347
|
-
In non-blocking mode, returns None if no data is available.
|
|
348
|
-
Return an empty bytes object at EOF.
|
|
349
|
-
"""
|
|
350
|
-
...
|
|
351
|
-
|
|
352
|
-
class BytesIO(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes
|
|
353
|
-
"""Buffered I/O implementation using an in-memory bytes buffer."""
|
|
354
|
-
def __init__(self, initial_bytes: ReadableBuffer = b"") -> None: ...
|
|
355
|
-
# BytesIO does not contain a "name" field. This workaround is necessary
|
|
356
|
-
# to allow BytesIO sub-classes to add this field, as it is defined
|
|
357
|
-
# as a read-only property on IO[].
|
|
358
|
-
name: Any
|
|
359
|
-
def getvalue(self) -> bytes:
|
|
360
|
-
"""Retrieve the entire contents of the BytesIO object."""
|
|
361
|
-
...
|
|
362
|
-
def getbuffer(self) -> memoryview:
|
|
363
|
-
"""Get a read-write view over the contents of the BytesIO object."""
|
|
364
|
-
...
|
|
365
|
-
def read1(self, size: int | None = -1, /) -> bytes:
|
|
366
|
-
"""
|
|
367
|
-
Read at most size bytes, returned as a bytes object.
|
|
368
|
-
|
|
369
|
-
If the size argument is negative or omitted, read until EOF is reached.
|
|
370
|
-
Return an empty bytes object at EOF.
|
|
371
|
-
"""
|
|
372
|
-
...
|
|
373
|
-
def readlines(self, size: int | None = None, /) -> list[bytes]:
|
|
374
|
-
"""
|
|
375
|
-
List of bytes objects, each a line from the file.
|
|
376
|
-
|
|
377
|
-
Call readline() repeatedly and return a list of the lines so read.
|
|
378
|
-
The optional size argument, if given, is an approximate bound on the
|
|
379
|
-
total number of bytes in the lines returned.
|
|
380
|
-
"""
|
|
381
|
-
...
|
|
382
|
-
def seek(self, pos: int, whence: int = 0, /) -> int:
|
|
383
|
-
"""
|
|
384
|
-
Change stream position.
|
|
385
|
-
|
|
386
|
-
Seek to byte offset pos relative to position indicated by whence:
|
|
387
|
-
0 Start of stream (the default). pos should be >= 0;
|
|
388
|
-
1 Current position - pos may be negative;
|
|
389
|
-
2 End of stream - pos usually negative.
|
|
390
|
-
Returns the new absolute position.
|
|
391
|
-
"""
|
|
392
|
-
...
|
|
393
|
-
|
|
394
|
-
class BufferedReader(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes
|
|
395
|
-
"""Create a new buffered reader using the given readable raw IO object."""
|
|
396
|
-
raw: RawIOBase
|
|
397
|
-
def __init__(self, raw: RawIOBase, buffer_size: int = 8192) -> None: ...
|
|
398
|
-
def peek(self, size: int = 0, /) -> bytes: ...
|
|
399
|
-
def seek(self, target: int, whence: int = 0, /) -> int: ...
|
|
400
|
-
def truncate(self, pos: int | None = None, /) -> int: ...
|
|
401
|
-
|
|
402
|
-
class BufferedWriter(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of writelines in the base classes
|
|
403
|
-
"""
|
|
404
|
-
A buffer for a writeable sequential RawIO object.
|
|
405
|
-
|
|
406
|
-
The constructor creates a BufferedWriter for the given writeable raw
|
|
407
|
-
stream. If the buffer_size is not given, it defaults to
|
|
408
|
-
DEFAULT_BUFFER_SIZE.
|
|
409
|
-
"""
|
|
410
|
-
raw: RawIOBase
|
|
411
|
-
def __init__(self, raw: RawIOBase, buffer_size: int = 8192) -> None: ...
|
|
412
|
-
def write(self, buffer: ReadableBuffer, /) -> int: ...
|
|
413
|
-
def seek(self, target: int, whence: int = 0, /) -> int: ...
|
|
414
|
-
def truncate(self, pos: int | None = None, /) -> int: ...
|
|
415
|
-
|
|
416
|
-
class BufferedRandom(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes
|
|
417
|
-
"""
|
|
418
|
-
A buffered interface to random access streams.
|
|
419
|
-
|
|
420
|
-
The constructor creates a reader and writer for a seekable stream,
|
|
421
|
-
raw, given in the first argument. If the buffer_size is omitted it
|
|
422
|
-
defaults to DEFAULT_BUFFER_SIZE.
|
|
423
|
-
"""
|
|
424
|
-
mode: str
|
|
425
|
-
name: Any
|
|
426
|
-
raw: RawIOBase
|
|
427
|
-
def __init__(self, raw: RawIOBase, buffer_size: int = 8192) -> None: ...
|
|
428
|
-
def seek(self, target: int, whence: int = 0, /) -> int: ... # stubtest needs this
|
|
429
|
-
def peek(self, size: int = 0, /) -> bytes: ...
|
|
430
|
-
def truncate(self, pos: int | None = None, /) -> int: ...
|
|
431
|
-
|
|
432
|
-
class BufferedRWPair(BufferedIOBase, _BufferedIOBase):
|
|
433
|
-
"""
|
|
434
|
-
A buffered reader and writer object together.
|
|
435
|
-
|
|
436
|
-
A buffered reader object and buffered writer object put together to
|
|
437
|
-
form a sequential IO object that can read and write. This is typically
|
|
438
|
-
used with a socket or two-way pipe.
|
|
439
|
-
|
|
440
|
-
reader and writer are RawIOBase objects that are readable and
|
|
441
|
-
writeable respectively. If the buffer_size is omitted it defaults to
|
|
442
|
-
DEFAULT_BUFFER_SIZE.
|
|
443
|
-
"""
|
|
444
|
-
def __init__(self, reader: RawIOBase, writer: RawIOBase, buffer_size: int = 8192) -> None: ...
|
|
445
|
-
def peek(self, size: int = 0, /) -> bytes: ...
|
|
446
|
-
|
|
447
|
-
class _TextIOBase(_IOBase):
|
|
448
|
-
"""
|
|
449
|
-
Base class for text I/O.
|
|
450
|
-
|
|
451
|
-
This class provides a character and line based interface to stream
|
|
452
|
-
I/O. There is no readinto method because Python's character strings
|
|
453
|
-
are immutable.
|
|
454
|
-
"""
|
|
455
|
-
encoding: str
|
|
456
|
-
errors: str | None
|
|
457
|
-
newlines: str | tuple[str, ...] | None
|
|
458
|
-
def __iter__(self) -> Iterator[str]:
|
|
459
|
-
"""Implement iter(self)."""
|
|
460
|
-
...
|
|
461
|
-
def __next__(self) -> str:
|
|
462
|
-
"""Implement next(self)."""
|
|
463
|
-
...
|
|
464
|
-
def detach(self) -> BinaryIO:
|
|
465
|
-
"""
|
|
466
|
-
Separate the underlying buffer from the TextIOBase and return it.
|
|
467
|
-
|
|
468
|
-
After the underlying buffer has been detached, the TextIO is in an unusable state.
|
|
469
|
-
"""
|
|
470
|
-
...
|
|
471
|
-
def write(self, s: str, /) -> int:
|
|
472
|
-
"""
|
|
473
|
-
Write string s to stream.
|
|
474
|
-
|
|
475
|
-
Return the number of characters written
|
|
476
|
-
(which is always equal to the length of the string).
|
|
477
|
-
"""
|
|
478
|
-
...
|
|
479
|
-
def writelines(self, lines: Iterable[str], /) -> None:
|
|
480
|
-
"""
|
|
481
|
-
Write a list of lines to stream.
|
|
482
|
-
|
|
483
|
-
Line separators are not added, so it is usual for each of the
|
|
484
|
-
lines provided to have a line separator at the end.
|
|
485
|
-
"""
|
|
486
|
-
...
|
|
487
|
-
def readline(self, size: int = -1, /) -> str:
|
|
488
|
-
"""
|
|
489
|
-
Read until newline or EOF.
|
|
490
|
-
|
|
491
|
-
Return an empty string if EOF is hit immediately.
|
|
492
|
-
If size is specified, at most size characters will be read.
|
|
493
|
-
"""
|
|
494
|
-
...
|
|
495
|
-
def readlines(self, hint: int = -1, /) -> list[str]:
|
|
496
|
-
"""
|
|
497
|
-
Return a list of lines from the stream.
|
|
498
|
-
|
|
499
|
-
hint can be specified to control the number of lines read: no more
|
|
500
|
-
lines will be read if the total size (in bytes/characters) of all
|
|
501
|
-
lines so far exceeds hint.
|
|
502
|
-
"""
|
|
503
|
-
...
|
|
504
|
-
def read(self, size: int | None = -1, /) -> str:
|
|
505
|
-
"""
|
|
506
|
-
Read at most size characters from stream.
|
|
507
|
-
|
|
508
|
-
Read from underlying buffer until we have size characters or we hit EOF.
|
|
509
|
-
If size is negative or omitted, read until EOF.
|
|
510
|
-
"""
|
|
511
|
-
...
|
|
512
|
-
|
|
513
|
-
@type_check_only
|
|
514
|
-
class _WrappedBuffer(Protocol):
|
|
515
|
-
# "name" is wrapped by TextIOWrapper. Its type is inconsistent between
|
|
516
|
-
# the various I/O types, see the comments on TextIOWrapper.name and
|
|
517
|
-
# TextIO.name.
|
|
518
|
-
@property
|
|
519
|
-
def name(self) -> Any: ...
|
|
520
|
-
@property
|
|
521
|
-
def closed(self) -> bool: ...
|
|
522
|
-
def read(self, size: int = ..., /) -> ReadableBuffer: ...
|
|
523
|
-
# Optional: def read1(self, size: int, /) -> ReadableBuffer: ...
|
|
524
|
-
def write(self, b: bytes, /) -> object: ...
|
|
525
|
-
def flush(self) -> object: ...
|
|
526
|
-
def close(self) -> object: ...
|
|
527
|
-
def seekable(self) -> bool: ...
|
|
528
|
-
def readable(self) -> bool: ...
|
|
529
|
-
def writable(self) -> bool: ...
|
|
530
|
-
def truncate(self, size: int, /) -> int: ...
|
|
531
|
-
def fileno(self) -> int: ...
|
|
532
|
-
def isatty(self) -> bool: ...
|
|
533
|
-
# Optional: Only needs to be present if seekable() returns True.
|
|
534
|
-
# def seek(self, offset: Literal[0], whence: Literal[2]) -> int: ...
|
|
535
|
-
# def tell(self) -> int: ...
|
|
536
|
-
|
|
537
|
-
_BufferT_co = TypeVar("_BufferT_co", bound=_WrappedBuffer, default=_WrappedBuffer, covariant=True)
|
|
538
|
-
|
|
539
|
-
class TextIOWrapper(TextIOBase, _TextIOBase, TextIO, Generic[_BufferT_co]): # type: ignore[misc] # incompatible definitions of write in the base classes
|
|
540
|
-
r"""
|
|
541
|
-
Character and line based layer over a BufferedIOBase object, buffer.
|
|
542
|
-
|
|
543
|
-
encoding gives the name of the encoding that the stream will be
|
|
544
|
-
decoded or encoded with. It defaults to locale.getencoding().
|
|
545
|
-
|
|
546
|
-
errors determines the strictness of encoding and decoding (see
|
|
547
|
-
help(codecs.Codec) or the documentation for codecs.register) and
|
|
548
|
-
defaults to "strict".
|
|
549
|
-
|
|
550
|
-
newline controls how line endings are handled. It can be None, '',
|
|
551
|
-
'\n', '\r', and '\r\n'. It works as follows:
|
|
552
|
-
|
|
553
|
-
* On input, if newline is None, universal newlines mode is
|
|
554
|
-
enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
|
|
555
|
-
these are translated into '\n' before being returned to the
|
|
556
|
-
caller. If it is '', universal newline mode is enabled, but line
|
|
557
|
-
endings are returned to the caller untranslated. If it has any of
|
|
558
|
-
the other legal values, input lines are only terminated by the given
|
|
559
|
-
string, and the line ending is returned to the caller untranslated.
|
|
560
|
-
|
|
561
|
-
* On output, if newline is None, any '\n' characters written are
|
|
562
|
-
translated to the system default line separator, os.linesep. If
|
|
563
|
-
newline is '' or '\n', no translation takes place. If newline is any
|
|
564
|
-
of the other legal values, any '\n' characters written are translated
|
|
565
|
-
to the given string.
|
|
566
|
-
|
|
567
|
-
If line_buffering is True, a call to flush is implied when a call to
|
|
568
|
-
write contains a newline character.
|
|
569
|
-
"""
|
|
570
|
-
def __init__(
|
|
571
|
-
self,
|
|
572
|
-
buffer: _BufferT_co,
|
|
573
|
-
encoding: str | None = None,
|
|
574
|
-
errors: str | None = None,
|
|
575
|
-
newline: str | None = None,
|
|
576
|
-
line_buffering: bool = False,
|
|
577
|
-
write_through: bool = False,
|
|
578
|
-
) -> None: ...
|
|
579
|
-
# Equals the "buffer" argument passed in to the constructor.
|
|
580
|
-
@property
|
|
581
|
-
def buffer(self) -> _BufferT_co: ... # type: ignore[override]
|
|
582
|
-
@property
|
|
583
|
-
def line_buffering(self) -> bool: ...
|
|
584
|
-
@property
|
|
585
|
-
def write_through(self) -> bool: ...
|
|
586
|
-
def reconfigure(
|
|
587
|
-
self,
|
|
588
|
-
*,
|
|
589
|
-
encoding: str | None = None,
|
|
590
|
-
errors: str | None = None,
|
|
591
|
-
newline: str | None = None,
|
|
592
|
-
line_buffering: bool | None = None,
|
|
593
|
-
write_through: bool | None = None,
|
|
594
|
-
) -> None:
|
|
595
|
-
"""
|
|
596
|
-
Reconfigure the text stream with new parameters.
|
|
597
|
-
|
|
598
|
-
This also does an implicit stream flush.
|
|
599
|
-
"""
|
|
600
|
-
...
|
|
601
|
-
def readline(self, size: int = -1, /) -> str: ... # type: ignore[override]
|
|
602
|
-
# Equals the "buffer" argument passed in to the constructor.
|
|
603
|
-
def detach(self) -> _BufferT_co: ... # type: ignore[override]
|
|
604
|
-
# TextIOWrapper's version of seek only supports a limited subset of
|
|
605
|
-
# operations.
|
|
606
|
-
def seek(self, cookie: int, whence: int = 0, /) -> int:
|
|
607
|
-
"""
|
|
608
|
-
Set the stream position, and return the new stream position.
|
|
609
|
-
|
|
610
|
-
cookie
|
|
611
|
-
Zero or an opaque number returned by tell().
|
|
612
|
-
whence
|
|
613
|
-
The relative position to seek from.
|
|
614
|
-
|
|
615
|
-
Four operations are supported, given by the following argument
|
|
616
|
-
combinations:
|
|
617
|
-
|
|
618
|
-
- seek(0, SEEK_SET): Rewind to the start of the stream.
|
|
619
|
-
- seek(cookie, SEEK_SET): Restore a previous position;
|
|
620
|
-
'cookie' must be a number returned by tell().
|
|
621
|
-
- seek(0, SEEK_END): Fast-forward to the end of the stream.
|
|
622
|
-
- seek(0, SEEK_CUR): Leave the current stream position unchanged.
|
|
623
|
-
|
|
624
|
-
Any other argument combinations are invalid,
|
|
625
|
-
and may raise exceptions.
|
|
626
|
-
"""
|
|
627
|
-
...
|
|
628
|
-
def truncate(self, pos: int | None = None, /) -> int: ...
|
|
629
|
-
|
|
630
|
-
class StringIO(TextIOBase, _TextIOBase, TextIO): # type: ignore[misc] # incompatible definitions of write in the base classes
|
|
631
|
-
"""
|
|
632
|
-
Text I/O implementation using an in-memory buffer.
|
|
633
|
-
|
|
634
|
-
The initial_value argument sets the value of object. The newline
|
|
635
|
-
argument is like the one of TextIOWrapper's constructor.
|
|
636
|
-
"""
|
|
637
|
-
def __init__(self, initial_value: str | None = "", newline: str | None = "\n") -> None: ...
|
|
638
|
-
# StringIO does not contain a "name" field. This workaround is necessary
|
|
639
|
-
# to allow StringIO sub-classes to add this field, as it is defined
|
|
640
|
-
# as a read-only property on IO[].
|
|
641
|
-
name: Any
|
|
642
|
-
def getvalue(self) -> str:
|
|
643
|
-
"""Retrieve the entire contents of the object."""
|
|
644
|
-
...
|
|
645
|
-
@property
|
|
646
|
-
def line_buffering(self) -> bool: ...
|
|
647
|
-
def seek(self, pos: int, whence: int = 0, /) -> int:
|
|
648
|
-
"""
|
|
649
|
-
Change stream position.
|
|
650
|
-
|
|
651
|
-
Seek to character offset pos relative to position indicated by whence:
|
|
652
|
-
0 Start of stream (the default). pos should be >= 0;
|
|
653
|
-
1 Current position - pos must be 0;
|
|
654
|
-
2 End of stream - pos must be 0.
|
|
655
|
-
Returns the new absolute position.
|
|
656
|
-
"""
|
|
657
|
-
...
|
|
658
|
-
def truncate(self, pos: int | None = None, /) -> int:
|
|
659
|
-
"""
|
|
660
|
-
Truncate size to pos.
|
|
661
|
-
|
|
662
|
-
The pos argument defaults to the current file position, as
|
|
663
|
-
returned by tell(). The current file position is unchanged.
|
|
664
|
-
Returns the new absolute position.
|
|
665
|
-
"""
|
|
666
|
-
...
|
|
667
|
-
|
|
668
|
-
class IncrementalNewlineDecoder:
|
|
669
|
-
r"""
|
|
670
|
-
Codec used when reading a file in universal newlines mode.
|
|
671
|
-
|
|
672
|
-
It wraps another incremental decoder, translating \r\n and \r into \n.
|
|
673
|
-
It also records the types of newlines encountered. When used with
|
|
674
|
-
translate=False, it ensures that the newline sequence is returned in
|
|
675
|
-
one piece. When used with decoder=None, it expects unicode strings as
|
|
676
|
-
decode input and translates newlines without first invoking an external
|
|
677
|
-
decoder.
|
|
678
|
-
"""
|
|
679
|
-
def __init__(self, decoder: codecs.IncrementalDecoder | None, translate: bool, errors: str = "strict") -> None: ...
|
|
680
|
-
def decode(self, input: ReadableBuffer | str, final: bool = False) -> str: ...
|
|
681
|
-
@property
|
|
682
|
-
def newlines(self) -> str | tuple[str, ...] | None: ...
|
|
683
|
-
def getstate(self) -> tuple[bytes, int]: ...
|
|
684
|
-
def reset(self) -> None: ...
|
|
685
|
-
def setstate(self, state: tuple[bytes, int], /) -> None: ...
|
|
686
|
-
|
|
687
|
-
if sys.version_info >= (3, 10):
|
|
688
|
-
@overload
|
|
689
|
-
def text_encoding(encoding: None, stacklevel: int = 2, /) -> Literal["locale", "utf-8"]:
|
|
690
|
-
"""
|
|
691
|
-
A helper function to choose the text encoding.
|
|
692
|
-
|
|
693
|
-
When encoding is not None, this function returns it.
|
|
694
|
-
Otherwise, this function returns the default text encoding
|
|
695
|
-
(i.e. "locale" or "utf-8" depends on UTF-8 mode).
|
|
696
|
-
|
|
697
|
-
This function emits an EncodingWarning if encoding is None and
|
|
698
|
-
sys.flags.warn_default_encoding is true.
|
|
699
|
-
|
|
700
|
-
This can be used in APIs with an encoding=None parameter.
|
|
701
|
-
However, please consider using encoding="utf-8" for new APIs.
|
|
702
|
-
"""
|
|
703
|
-
...
|
|
704
|
-
@overload
|
|
705
|
-
def text_encoding(encoding: _T, stacklevel: int = 2, /) -> _T:
|
|
706
|
-
"""
|
|
707
|
-
A helper function to choose the text encoding.
|
|
708
|
-
|
|
709
|
-
When encoding is not None, this function returns it.
|
|
710
|
-
Otherwise, this function returns the default text encoding
|
|
711
|
-
(i.e. "locale" or "utf-8" depends on UTF-8 mode).
|
|
712
|
-
|
|
713
|
-
This function emits an EncodingWarning if encoding is None and
|
|
714
|
-
sys.flags.warn_default_encoding is true.
|
|
715
|
-
|
|
716
|
-
This can be used in APIs with an encoding=None parameter.
|
|
717
|
-
However, please consider using encoding="utf-8" for new APIs.
|
|
718
|
-
"""
|
|
719
|
-
...
|
|
1
|
+
"""
|
|
2
|
+
The io module provides the Python interfaces to stream handling. The
|
|
3
|
+
builtin open function is defined in this module.
|
|
4
|
+
|
|
5
|
+
At the top of the I/O hierarchy is the abstract base class IOBase. It
|
|
6
|
+
defines the basic interface to a stream. Note, however, that there is no
|
|
7
|
+
separation between reading and writing to streams; implementations are
|
|
8
|
+
allowed to raise an OSError if they do not support a given operation.
|
|
9
|
+
|
|
10
|
+
Extending IOBase is RawIOBase which deals simply with the reading and
|
|
11
|
+
writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
|
|
12
|
+
an interface to OS files.
|
|
13
|
+
|
|
14
|
+
BufferedIOBase deals with buffering on a raw byte stream (RawIOBase). Its
|
|
15
|
+
subclasses, BufferedWriter, BufferedReader, and BufferedRWPair buffer
|
|
16
|
+
streams that are readable, writable, and both respectively.
|
|
17
|
+
BufferedRandom provides a buffered interface to random access
|
|
18
|
+
streams. BytesIO is a simple stream of in-memory bytes.
|
|
19
|
+
|
|
20
|
+
Another IOBase subclass, TextIOBase, deals with the encoding and decoding
|
|
21
|
+
of streams into text. TextIOWrapper, which extends it, is a buffered text
|
|
22
|
+
interface to a buffered raw stream (`BufferedIOBase`). Finally, StringIO
|
|
23
|
+
is an in-memory stream for text.
|
|
24
|
+
|
|
25
|
+
Argument names are not part of the specification, and only the arguments
|
|
26
|
+
of open() are intended to be used as keyword arguments.
|
|
27
|
+
|
|
28
|
+
data:
|
|
29
|
+
|
|
30
|
+
DEFAULT_BUFFER_SIZE
|
|
31
|
+
|
|
32
|
+
An int containing the default buffer size used by the module's buffered
|
|
33
|
+
I/O classes. open() uses the file's blksize (as obtained by os.stat) if
|
|
34
|
+
possible.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
import builtins
|
|
38
|
+
import codecs
|
|
39
|
+
import sys
|
|
40
|
+
from _typeshed import FileDescriptorOrPath, MaybeNone, ReadableBuffer, WriteableBuffer
|
|
41
|
+
from collections.abc import Callable, Iterable, Iterator
|
|
42
|
+
from io import BufferedIOBase, RawIOBase, TextIOBase, UnsupportedOperation as UnsupportedOperation
|
|
43
|
+
from os import _Opener
|
|
44
|
+
from types import TracebackType
|
|
45
|
+
from typing import IO, Any, BinaryIO, Final, Generic, Literal, Protocol, TextIO, TypeVar, overload, type_check_only
|
|
46
|
+
from typing_extensions import Self
|
|
47
|
+
|
|
48
|
+
_T = TypeVar("_T")
|
|
49
|
+
|
|
50
|
+
DEFAULT_BUFFER_SIZE: Final = 8192
|
|
51
|
+
|
|
52
|
+
open = builtins.open
|
|
53
|
+
|
|
54
|
+
def open_code(path: str) -> IO[bytes]:
|
|
55
|
+
"""
|
|
56
|
+
Opens the provided file with the intent to import the contents.
|
|
57
|
+
|
|
58
|
+
This may perform extra validation beyond open(), but is otherwise interchangeable
|
|
59
|
+
with calling open(path, 'rb').
|
|
60
|
+
"""
|
|
61
|
+
...
|
|
62
|
+
|
|
63
|
+
BlockingIOError = builtins.BlockingIOError
|
|
64
|
+
|
|
65
|
+
class _IOBase:
|
|
66
|
+
"""
|
|
67
|
+
The abstract base class for all I/O classes.
|
|
68
|
+
|
|
69
|
+
This class provides dummy implementations for many methods that
|
|
70
|
+
derived classes can override selectively; the default implementations
|
|
71
|
+
represent a file that cannot be read, written or seeked.
|
|
72
|
+
|
|
73
|
+
Even though IOBase does not declare read, readinto, or write because
|
|
74
|
+
their signatures will vary, implementations and clients should
|
|
75
|
+
consider those methods part of the interface. Also, implementations
|
|
76
|
+
may raise UnsupportedOperation when operations they do not support are
|
|
77
|
+
called.
|
|
78
|
+
|
|
79
|
+
The basic type used for binary data read from or written to a file is
|
|
80
|
+
bytes. Other bytes-like objects are accepted as method arguments too.
|
|
81
|
+
In some cases (such as readinto), a writable object is required. Text
|
|
82
|
+
I/O classes work with str data.
|
|
83
|
+
|
|
84
|
+
Note that calling any method (except additional calls to close(),
|
|
85
|
+
which are ignored) on a closed stream should raise a ValueError.
|
|
86
|
+
|
|
87
|
+
IOBase (and its subclasses) support the iterator protocol, meaning
|
|
88
|
+
that an IOBase object can be iterated over yielding the lines in a
|
|
89
|
+
stream.
|
|
90
|
+
|
|
91
|
+
IOBase also supports the :keyword:`with` statement. In this example,
|
|
92
|
+
fp is closed after the suite of the with statement is complete:
|
|
93
|
+
|
|
94
|
+
with open('spam.txt', 'r') as fp:
|
|
95
|
+
fp.write('Spam and eggs!')
|
|
96
|
+
"""
|
|
97
|
+
def __iter__(self) -> Iterator[bytes]:
|
|
98
|
+
"""Implement iter(self)."""
|
|
99
|
+
...
|
|
100
|
+
def __next__(self) -> bytes:
|
|
101
|
+
"""Implement next(self)."""
|
|
102
|
+
...
|
|
103
|
+
def __enter__(self) -> Self: ...
|
|
104
|
+
def __exit__(
|
|
105
|
+
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
|
106
|
+
) -> None: ...
|
|
107
|
+
def close(self) -> None:
|
|
108
|
+
"""
|
|
109
|
+
Flush and close the IO object.
|
|
110
|
+
|
|
111
|
+
This method has no effect if the file is already closed.
|
|
112
|
+
"""
|
|
113
|
+
...
|
|
114
|
+
def fileno(self) -> int:
|
|
115
|
+
"""
|
|
116
|
+
Return underlying file descriptor if one exists.
|
|
117
|
+
|
|
118
|
+
Raise OSError if the IO object does not use a file descriptor.
|
|
119
|
+
"""
|
|
120
|
+
...
|
|
121
|
+
def flush(self) -> None:
|
|
122
|
+
"""
|
|
123
|
+
Flush write buffers, if applicable.
|
|
124
|
+
|
|
125
|
+
This is not implemented for read-only and non-blocking streams.
|
|
126
|
+
"""
|
|
127
|
+
...
|
|
128
|
+
def isatty(self) -> bool:
|
|
129
|
+
"""
|
|
130
|
+
Return whether this is an 'interactive' stream.
|
|
131
|
+
|
|
132
|
+
Return False if it can't be determined.
|
|
133
|
+
"""
|
|
134
|
+
...
|
|
135
|
+
def readable(self) -> bool:
|
|
136
|
+
"""
|
|
137
|
+
Return whether object was opened for reading.
|
|
138
|
+
|
|
139
|
+
If False, read() will raise OSError.
|
|
140
|
+
"""
|
|
141
|
+
...
|
|
142
|
+
read: Callable[..., Any]
|
|
143
|
+
def readlines(self, hint: int = -1, /) -> list[bytes]:
|
|
144
|
+
"""
|
|
145
|
+
Return a list of lines from the stream.
|
|
146
|
+
|
|
147
|
+
hint can be specified to control the number of lines read: no more
|
|
148
|
+
lines will be read if the total size (in bytes/characters) of all
|
|
149
|
+
lines so far exceeds hint.
|
|
150
|
+
"""
|
|
151
|
+
...
|
|
152
|
+
def seek(self, offset: int, whence: int = 0, /) -> int:
|
|
153
|
+
"""
|
|
154
|
+
Change the stream position to the given byte offset.
|
|
155
|
+
|
|
156
|
+
offset
|
|
157
|
+
The stream position, relative to 'whence'.
|
|
158
|
+
whence
|
|
159
|
+
The relative position to seek from.
|
|
160
|
+
|
|
161
|
+
The offset is interpreted relative to the position indicated by whence.
|
|
162
|
+
Values for whence are:
|
|
163
|
+
|
|
164
|
+
* os.SEEK_SET or 0 -- start of stream (the default); offset should be zero or positive
|
|
165
|
+
* os.SEEK_CUR or 1 -- current stream position; offset may be negative
|
|
166
|
+
* os.SEEK_END or 2 -- end of stream; offset is usually negative
|
|
167
|
+
|
|
168
|
+
Return the new absolute position.
|
|
169
|
+
"""
|
|
170
|
+
...
|
|
171
|
+
def seekable(self) -> bool:
|
|
172
|
+
"""
|
|
173
|
+
Return whether object supports random access.
|
|
174
|
+
|
|
175
|
+
If False, seek(), tell() and truncate() will raise OSError.
|
|
176
|
+
This method may need to do a test seek().
|
|
177
|
+
"""
|
|
178
|
+
...
|
|
179
|
+
def tell(self) -> int:
|
|
180
|
+
"""Return current stream position."""
|
|
181
|
+
...
|
|
182
|
+
def truncate(self, size: int | None = None, /) -> int:
|
|
183
|
+
"""
|
|
184
|
+
Truncate file to size bytes.
|
|
185
|
+
|
|
186
|
+
File pointer is left unchanged. Size defaults to the current IO position
|
|
187
|
+
as reported by tell(). Return the new size.
|
|
188
|
+
"""
|
|
189
|
+
...
|
|
190
|
+
def writable(self) -> bool:
|
|
191
|
+
"""
|
|
192
|
+
Return whether object was opened for writing.
|
|
193
|
+
|
|
194
|
+
If False, write() will raise OSError.
|
|
195
|
+
"""
|
|
196
|
+
...
|
|
197
|
+
write: Callable[..., Any]
|
|
198
|
+
def writelines(self, lines: Iterable[ReadableBuffer], /) -> None:
|
|
199
|
+
"""
|
|
200
|
+
Write a list of lines to stream.
|
|
201
|
+
|
|
202
|
+
Line separators are not added, so it is usual for each of the
|
|
203
|
+
lines provided to have a line separator at the end.
|
|
204
|
+
"""
|
|
205
|
+
...
|
|
206
|
+
def readline(self, size: int | None = -1, /) -> bytes:
|
|
207
|
+
r"""
|
|
208
|
+
Read and return a line from the stream.
|
|
209
|
+
|
|
210
|
+
If size is specified, at most size bytes will be read.
|
|
211
|
+
|
|
212
|
+
The line terminator is always b'\n' for binary files; for text
|
|
213
|
+
files, the newlines argument to open can be used to select the line
|
|
214
|
+
terminator(s) recognized.
|
|
215
|
+
"""
|
|
216
|
+
...
|
|
217
|
+
def __del__(self) -> None:
|
|
218
|
+
"""Called when the instance is about to be destroyed."""
|
|
219
|
+
...
|
|
220
|
+
@property
|
|
221
|
+
def closed(self) -> bool: ...
|
|
222
|
+
def _checkClosed(self) -> None: ... # undocumented
|
|
223
|
+
|
|
224
|
+
class _RawIOBase(_IOBase):
|
|
225
|
+
"""Base class for raw binary I/O."""
|
|
226
|
+
def readall(self) -> bytes:
|
|
227
|
+
"""Read until EOF, using multiple read() call."""
|
|
228
|
+
...
|
|
229
|
+
# The following methods can return None if the file is in non-blocking mode
|
|
230
|
+
# and no data is available.
|
|
231
|
+
def readinto(self, buffer: WriteableBuffer, /) -> int | MaybeNone: ...
|
|
232
|
+
def write(self, b: ReadableBuffer, /) -> int | MaybeNone: ...
|
|
233
|
+
def read(self, size: int = -1, /) -> bytes | MaybeNone: ...
|
|
234
|
+
|
|
235
|
+
class _BufferedIOBase(_IOBase):
|
|
236
|
+
"""
|
|
237
|
+
Base class for buffered IO objects.
|
|
238
|
+
|
|
239
|
+
The main difference with RawIOBase is that the read() method
|
|
240
|
+
supports omitting the size argument, and does not have a default
|
|
241
|
+
implementation that defers to readinto().
|
|
242
|
+
|
|
243
|
+
In addition, read(), readinto() and write() may raise
|
|
244
|
+
BlockingIOError if the underlying raw stream is in non-blocking
|
|
245
|
+
mode and not ready; unlike their raw counterparts, they will never
|
|
246
|
+
return None.
|
|
247
|
+
|
|
248
|
+
A typical implementation should not inherit from a RawIOBase
|
|
249
|
+
implementation, but wrap one.
|
|
250
|
+
"""
|
|
251
|
+
def detach(self) -> RawIOBase:
|
|
252
|
+
"""
|
|
253
|
+
Disconnect this buffer from its underlying raw stream and return it.
|
|
254
|
+
|
|
255
|
+
After the raw stream has been detached, the buffer is in an unusable
|
|
256
|
+
state.
|
|
257
|
+
"""
|
|
258
|
+
...
|
|
259
|
+
def readinto(self, buffer: WriteableBuffer, /) -> int: ...
|
|
260
|
+
def write(self, buffer: ReadableBuffer, /) -> int:
|
|
261
|
+
"""
|
|
262
|
+
Write buffer b to the IO stream.
|
|
263
|
+
|
|
264
|
+
Return the number of bytes written, which is always
|
|
265
|
+
the length of b in bytes.
|
|
266
|
+
|
|
267
|
+
Raise BlockingIOError if the buffer is full and the
|
|
268
|
+
underlying raw stream cannot accept more data at the moment.
|
|
269
|
+
"""
|
|
270
|
+
...
|
|
271
|
+
def readinto1(self, buffer: WriteableBuffer, /) -> int: ...
|
|
272
|
+
def read(self, size: int | None = -1, /) -> bytes:
|
|
273
|
+
"""
|
|
274
|
+
Read and return up to n bytes.
|
|
275
|
+
|
|
276
|
+
If the size argument is omitted, None, or negative, read and
|
|
277
|
+
return all data until EOF.
|
|
278
|
+
|
|
279
|
+
If the size argument is positive, and the underlying raw stream is
|
|
280
|
+
not 'interactive', multiple raw reads may be issued to satisfy
|
|
281
|
+
the byte count (unless EOF is reached first).
|
|
282
|
+
However, for interactive raw streams (as well as sockets and pipes),
|
|
283
|
+
at most one raw read will be issued, and a short result does not
|
|
284
|
+
imply that EOF is imminent.
|
|
285
|
+
|
|
286
|
+
Return an empty bytes object on EOF.
|
|
287
|
+
|
|
288
|
+
Return None if the underlying raw stream was open in non-blocking
|
|
289
|
+
mode and no data is available at the moment.
|
|
290
|
+
"""
|
|
291
|
+
...
|
|
292
|
+
def read1(self, size: int = -1, /) -> bytes:
|
|
293
|
+
"""
|
|
294
|
+
Read and return up to size bytes, with at most one read() call to the underlying raw stream.
|
|
295
|
+
|
|
296
|
+
Return an empty bytes object on EOF.
|
|
297
|
+
A short result does not imply that EOF is imminent.
|
|
298
|
+
"""
|
|
299
|
+
...
|
|
300
|
+
|
|
301
|
+
class FileIO(RawIOBase, _RawIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of writelines in the base classes
|
|
302
|
+
"""
|
|
303
|
+
Open a file.
|
|
304
|
+
|
|
305
|
+
The mode can be 'r' (default), 'w', 'x' or 'a' for reading,
|
|
306
|
+
writing, exclusive creation or appending. The file will be created if it
|
|
307
|
+
doesn't exist when opened for writing or appending; it will be truncated
|
|
308
|
+
when opened for writing. A FileExistsError will be raised if it already
|
|
309
|
+
exists when opened for creating. Opening a file for creating implies
|
|
310
|
+
writing so this mode behaves in a similar way to 'w'.Add a '+' to the mode
|
|
311
|
+
to allow simultaneous reading and writing. A custom opener can be used by
|
|
312
|
+
passing a callable as *opener*. The underlying file descriptor for the file
|
|
313
|
+
object is then obtained by calling opener with (*name*, *flags*).
|
|
314
|
+
*opener* must return an open file descriptor (passing os.open as *opener*
|
|
315
|
+
results in functionality similar to passing None).
|
|
316
|
+
"""
|
|
317
|
+
mode: str
|
|
318
|
+
# The type of "name" equals the argument passed in to the constructor,
|
|
319
|
+
# but that can make FileIO incompatible with other I/O types that assume
|
|
320
|
+
# "name" is a str. In the future, making FileIO generic might help.
|
|
321
|
+
name: Any
|
|
322
|
+
def __init__(
|
|
323
|
+
self, file: FileDescriptorOrPath, mode: str = "r", closefd: bool = True, opener: _Opener | None = None
|
|
324
|
+
) -> None: ...
|
|
325
|
+
@property
|
|
326
|
+
def closefd(self) -> bool:
|
|
327
|
+
"""True if the file descriptor will be closed by close()."""
|
|
328
|
+
...
|
|
329
|
+
def seek(self, pos: int, whence: int = 0, /) -> int:
|
|
330
|
+
"""
|
|
331
|
+
Move to new file position and return the file position.
|
|
332
|
+
|
|
333
|
+
Argument offset is a byte count. Optional argument whence defaults to
|
|
334
|
+
SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values
|
|
335
|
+
are SEEK_CUR or 1 (move relative to current position, positive or negative),
|
|
336
|
+
and SEEK_END or 2 (move relative to end of file, usually negative, although
|
|
337
|
+
many platforms allow seeking beyond the end of a file).
|
|
338
|
+
|
|
339
|
+
Note that not all file objects are seekable.
|
|
340
|
+
"""
|
|
341
|
+
...
|
|
342
|
+
def read(self, size: int | None = -1, /) -> bytes | MaybeNone:
|
|
343
|
+
"""
|
|
344
|
+
Read at most size bytes, returned as bytes.
|
|
345
|
+
|
|
346
|
+
Only makes one system call, so less data may be returned than requested.
|
|
347
|
+
In non-blocking mode, returns None if no data is available.
|
|
348
|
+
Return an empty bytes object at EOF.
|
|
349
|
+
"""
|
|
350
|
+
...
|
|
351
|
+
|
|
352
|
+
class BytesIO(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes
|
|
353
|
+
"""Buffered I/O implementation using an in-memory bytes buffer."""
|
|
354
|
+
def __init__(self, initial_bytes: ReadableBuffer = b"") -> None: ...
|
|
355
|
+
# BytesIO does not contain a "name" field. This workaround is necessary
|
|
356
|
+
# to allow BytesIO sub-classes to add this field, as it is defined
|
|
357
|
+
# as a read-only property on IO[].
|
|
358
|
+
name: Any
|
|
359
|
+
def getvalue(self) -> bytes:
|
|
360
|
+
"""Retrieve the entire contents of the BytesIO object."""
|
|
361
|
+
...
|
|
362
|
+
def getbuffer(self) -> memoryview:
|
|
363
|
+
"""Get a read-write view over the contents of the BytesIO object."""
|
|
364
|
+
...
|
|
365
|
+
def read1(self, size: int | None = -1, /) -> bytes:
|
|
366
|
+
"""
|
|
367
|
+
Read at most size bytes, returned as a bytes object.
|
|
368
|
+
|
|
369
|
+
If the size argument is negative or omitted, read until EOF is reached.
|
|
370
|
+
Return an empty bytes object at EOF.
|
|
371
|
+
"""
|
|
372
|
+
...
|
|
373
|
+
def readlines(self, size: int | None = None, /) -> list[bytes]:
|
|
374
|
+
"""
|
|
375
|
+
List of bytes objects, each a line from the file.
|
|
376
|
+
|
|
377
|
+
Call readline() repeatedly and return a list of the lines so read.
|
|
378
|
+
The optional size argument, if given, is an approximate bound on the
|
|
379
|
+
total number of bytes in the lines returned.
|
|
380
|
+
"""
|
|
381
|
+
...
|
|
382
|
+
def seek(self, pos: int, whence: int = 0, /) -> int:
|
|
383
|
+
"""
|
|
384
|
+
Change stream position.
|
|
385
|
+
|
|
386
|
+
Seek to byte offset pos relative to position indicated by whence:
|
|
387
|
+
0 Start of stream (the default). pos should be >= 0;
|
|
388
|
+
1 Current position - pos may be negative;
|
|
389
|
+
2 End of stream - pos usually negative.
|
|
390
|
+
Returns the new absolute position.
|
|
391
|
+
"""
|
|
392
|
+
...
|
|
393
|
+
|
|
394
|
+
class BufferedReader(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes
|
|
395
|
+
"""Create a new buffered reader using the given readable raw IO object."""
|
|
396
|
+
raw: RawIOBase
|
|
397
|
+
def __init__(self, raw: RawIOBase, buffer_size: int = 8192) -> None: ...
|
|
398
|
+
def peek(self, size: int = 0, /) -> bytes: ...
|
|
399
|
+
def seek(self, target: int, whence: int = 0, /) -> int: ...
|
|
400
|
+
def truncate(self, pos: int | None = None, /) -> int: ...
|
|
401
|
+
|
|
402
|
+
class BufferedWriter(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of writelines in the base classes
|
|
403
|
+
"""
|
|
404
|
+
A buffer for a writeable sequential RawIO object.
|
|
405
|
+
|
|
406
|
+
The constructor creates a BufferedWriter for the given writeable raw
|
|
407
|
+
stream. If the buffer_size is not given, it defaults to
|
|
408
|
+
DEFAULT_BUFFER_SIZE.
|
|
409
|
+
"""
|
|
410
|
+
raw: RawIOBase
|
|
411
|
+
def __init__(self, raw: RawIOBase, buffer_size: int = 8192) -> None: ...
|
|
412
|
+
def write(self, buffer: ReadableBuffer, /) -> int: ...
|
|
413
|
+
def seek(self, target: int, whence: int = 0, /) -> int: ...
|
|
414
|
+
def truncate(self, pos: int | None = None, /) -> int: ...
|
|
415
|
+
|
|
416
|
+
class BufferedRandom(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes
|
|
417
|
+
"""
|
|
418
|
+
A buffered interface to random access streams.
|
|
419
|
+
|
|
420
|
+
The constructor creates a reader and writer for a seekable stream,
|
|
421
|
+
raw, given in the first argument. If the buffer_size is omitted it
|
|
422
|
+
defaults to DEFAULT_BUFFER_SIZE.
|
|
423
|
+
"""
|
|
424
|
+
mode: str
|
|
425
|
+
name: Any
|
|
426
|
+
raw: RawIOBase
|
|
427
|
+
def __init__(self, raw: RawIOBase, buffer_size: int = 8192) -> None: ...
|
|
428
|
+
def seek(self, target: int, whence: int = 0, /) -> int: ... # stubtest needs this
|
|
429
|
+
def peek(self, size: int = 0, /) -> bytes: ...
|
|
430
|
+
def truncate(self, pos: int | None = None, /) -> int: ...
|
|
431
|
+
|
|
432
|
+
class BufferedRWPair(BufferedIOBase, _BufferedIOBase):
|
|
433
|
+
"""
|
|
434
|
+
A buffered reader and writer object together.
|
|
435
|
+
|
|
436
|
+
A buffered reader object and buffered writer object put together to
|
|
437
|
+
form a sequential IO object that can read and write. This is typically
|
|
438
|
+
used with a socket or two-way pipe.
|
|
439
|
+
|
|
440
|
+
reader and writer are RawIOBase objects that are readable and
|
|
441
|
+
writeable respectively. If the buffer_size is omitted it defaults to
|
|
442
|
+
DEFAULT_BUFFER_SIZE.
|
|
443
|
+
"""
|
|
444
|
+
def __init__(self, reader: RawIOBase, writer: RawIOBase, buffer_size: int = 8192) -> None: ...
|
|
445
|
+
def peek(self, size: int = 0, /) -> bytes: ...
|
|
446
|
+
|
|
447
|
+
class _TextIOBase(_IOBase):
|
|
448
|
+
"""
|
|
449
|
+
Base class for text I/O.
|
|
450
|
+
|
|
451
|
+
This class provides a character and line based interface to stream
|
|
452
|
+
I/O. There is no readinto method because Python's character strings
|
|
453
|
+
are immutable.
|
|
454
|
+
"""
|
|
455
|
+
encoding: str
|
|
456
|
+
errors: str | None
|
|
457
|
+
newlines: str | tuple[str, ...] | None
|
|
458
|
+
def __iter__(self) -> Iterator[str]:
|
|
459
|
+
"""Implement iter(self)."""
|
|
460
|
+
...
|
|
461
|
+
def __next__(self) -> str:
|
|
462
|
+
"""Implement next(self)."""
|
|
463
|
+
...
|
|
464
|
+
def detach(self) -> BinaryIO:
|
|
465
|
+
"""
|
|
466
|
+
Separate the underlying buffer from the TextIOBase and return it.
|
|
467
|
+
|
|
468
|
+
After the underlying buffer has been detached, the TextIO is in an unusable state.
|
|
469
|
+
"""
|
|
470
|
+
...
|
|
471
|
+
def write(self, s: str, /) -> int:
|
|
472
|
+
"""
|
|
473
|
+
Write string s to stream.
|
|
474
|
+
|
|
475
|
+
Return the number of characters written
|
|
476
|
+
(which is always equal to the length of the string).
|
|
477
|
+
"""
|
|
478
|
+
...
|
|
479
|
+
def writelines(self, lines: Iterable[str], /) -> None:
|
|
480
|
+
"""
|
|
481
|
+
Write a list of lines to stream.
|
|
482
|
+
|
|
483
|
+
Line separators are not added, so it is usual for each of the
|
|
484
|
+
lines provided to have a line separator at the end.
|
|
485
|
+
"""
|
|
486
|
+
...
|
|
487
|
+
def readline(self, size: int = -1, /) -> str:
|
|
488
|
+
"""
|
|
489
|
+
Read until newline or EOF.
|
|
490
|
+
|
|
491
|
+
Return an empty string if EOF is hit immediately.
|
|
492
|
+
If size is specified, at most size characters will be read.
|
|
493
|
+
"""
|
|
494
|
+
...
|
|
495
|
+
def readlines(self, hint: int = -1, /) -> list[str]:
|
|
496
|
+
"""
|
|
497
|
+
Return a list of lines from the stream.
|
|
498
|
+
|
|
499
|
+
hint can be specified to control the number of lines read: no more
|
|
500
|
+
lines will be read if the total size (in bytes/characters) of all
|
|
501
|
+
lines so far exceeds hint.
|
|
502
|
+
"""
|
|
503
|
+
...
|
|
504
|
+
def read(self, size: int | None = -1, /) -> str:
|
|
505
|
+
"""
|
|
506
|
+
Read at most size characters from stream.
|
|
507
|
+
|
|
508
|
+
Read from underlying buffer until we have size characters or we hit EOF.
|
|
509
|
+
If size is negative or omitted, read until EOF.
|
|
510
|
+
"""
|
|
511
|
+
...
|
|
512
|
+
|
|
513
|
+
@type_check_only
|
|
514
|
+
class _WrappedBuffer(Protocol):
|
|
515
|
+
# "name" is wrapped by TextIOWrapper. Its type is inconsistent between
|
|
516
|
+
# the various I/O types, see the comments on TextIOWrapper.name and
|
|
517
|
+
# TextIO.name.
|
|
518
|
+
@property
|
|
519
|
+
def name(self) -> Any: ...
|
|
520
|
+
@property
|
|
521
|
+
def closed(self) -> bool: ...
|
|
522
|
+
def read(self, size: int = ..., /) -> ReadableBuffer: ...
|
|
523
|
+
# Optional: def read1(self, size: int, /) -> ReadableBuffer: ...
|
|
524
|
+
def write(self, b: bytes, /) -> object: ...
|
|
525
|
+
def flush(self) -> object: ...
|
|
526
|
+
def close(self) -> object: ...
|
|
527
|
+
def seekable(self) -> bool: ...
|
|
528
|
+
def readable(self) -> bool: ...
|
|
529
|
+
def writable(self) -> bool: ...
|
|
530
|
+
def truncate(self, size: int, /) -> int: ...
|
|
531
|
+
def fileno(self) -> int: ...
|
|
532
|
+
def isatty(self) -> bool: ...
|
|
533
|
+
# Optional: Only needs to be present if seekable() returns True.
|
|
534
|
+
# def seek(self, offset: Literal[0], whence: Literal[2]) -> int: ...
|
|
535
|
+
# def tell(self) -> int: ...
|
|
536
|
+
|
|
537
|
+
_BufferT_co = TypeVar("_BufferT_co", bound=_WrappedBuffer, default=_WrappedBuffer, covariant=True)
|
|
538
|
+
|
|
539
|
+
class TextIOWrapper(TextIOBase, _TextIOBase, TextIO, Generic[_BufferT_co]): # type: ignore[misc] # incompatible definitions of write in the base classes
|
|
540
|
+
r"""
|
|
541
|
+
Character and line based layer over a BufferedIOBase object, buffer.
|
|
542
|
+
|
|
543
|
+
encoding gives the name of the encoding that the stream will be
|
|
544
|
+
decoded or encoded with. It defaults to locale.getencoding().
|
|
545
|
+
|
|
546
|
+
errors determines the strictness of encoding and decoding (see
|
|
547
|
+
help(codecs.Codec) or the documentation for codecs.register) and
|
|
548
|
+
defaults to "strict".
|
|
549
|
+
|
|
550
|
+
newline controls how line endings are handled. It can be None, '',
|
|
551
|
+
'\n', '\r', and '\r\n'. It works as follows:
|
|
552
|
+
|
|
553
|
+
* On input, if newline is None, universal newlines mode is
|
|
554
|
+
enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
|
|
555
|
+
these are translated into '\n' before being returned to the
|
|
556
|
+
caller. If it is '', universal newline mode is enabled, but line
|
|
557
|
+
endings are returned to the caller untranslated. If it has any of
|
|
558
|
+
the other legal values, input lines are only terminated by the given
|
|
559
|
+
string, and the line ending is returned to the caller untranslated.
|
|
560
|
+
|
|
561
|
+
* On output, if newline is None, any '\n' characters written are
|
|
562
|
+
translated to the system default line separator, os.linesep. If
|
|
563
|
+
newline is '' or '\n', no translation takes place. If newline is any
|
|
564
|
+
of the other legal values, any '\n' characters written are translated
|
|
565
|
+
to the given string.
|
|
566
|
+
|
|
567
|
+
If line_buffering is True, a call to flush is implied when a call to
|
|
568
|
+
write contains a newline character.
|
|
569
|
+
"""
|
|
570
|
+
def __init__(
|
|
571
|
+
self,
|
|
572
|
+
buffer: _BufferT_co,
|
|
573
|
+
encoding: str | None = None,
|
|
574
|
+
errors: str | None = None,
|
|
575
|
+
newline: str | None = None,
|
|
576
|
+
line_buffering: bool = False,
|
|
577
|
+
write_through: bool = False,
|
|
578
|
+
) -> None: ...
|
|
579
|
+
# Equals the "buffer" argument passed in to the constructor.
|
|
580
|
+
@property
|
|
581
|
+
def buffer(self) -> _BufferT_co: ... # type: ignore[override]
|
|
582
|
+
@property
|
|
583
|
+
def line_buffering(self) -> bool: ...
|
|
584
|
+
@property
|
|
585
|
+
def write_through(self) -> bool: ...
|
|
586
|
+
def reconfigure(
|
|
587
|
+
self,
|
|
588
|
+
*,
|
|
589
|
+
encoding: str | None = None,
|
|
590
|
+
errors: str | None = None,
|
|
591
|
+
newline: str | None = None,
|
|
592
|
+
line_buffering: bool | None = None,
|
|
593
|
+
write_through: bool | None = None,
|
|
594
|
+
) -> None:
|
|
595
|
+
"""
|
|
596
|
+
Reconfigure the text stream with new parameters.
|
|
597
|
+
|
|
598
|
+
This also does an implicit stream flush.
|
|
599
|
+
"""
|
|
600
|
+
...
|
|
601
|
+
def readline(self, size: int = -1, /) -> str: ... # type: ignore[override]
|
|
602
|
+
# Equals the "buffer" argument passed in to the constructor.
|
|
603
|
+
def detach(self) -> _BufferT_co: ... # type: ignore[override]
|
|
604
|
+
# TextIOWrapper's version of seek only supports a limited subset of
|
|
605
|
+
# operations.
|
|
606
|
+
def seek(self, cookie: int, whence: int = 0, /) -> int:
|
|
607
|
+
"""
|
|
608
|
+
Set the stream position, and return the new stream position.
|
|
609
|
+
|
|
610
|
+
cookie
|
|
611
|
+
Zero or an opaque number returned by tell().
|
|
612
|
+
whence
|
|
613
|
+
The relative position to seek from.
|
|
614
|
+
|
|
615
|
+
Four operations are supported, given by the following argument
|
|
616
|
+
combinations:
|
|
617
|
+
|
|
618
|
+
- seek(0, SEEK_SET): Rewind to the start of the stream.
|
|
619
|
+
- seek(cookie, SEEK_SET): Restore a previous position;
|
|
620
|
+
'cookie' must be a number returned by tell().
|
|
621
|
+
- seek(0, SEEK_END): Fast-forward to the end of the stream.
|
|
622
|
+
- seek(0, SEEK_CUR): Leave the current stream position unchanged.
|
|
623
|
+
|
|
624
|
+
Any other argument combinations are invalid,
|
|
625
|
+
and may raise exceptions.
|
|
626
|
+
"""
|
|
627
|
+
...
|
|
628
|
+
def truncate(self, pos: int | None = None, /) -> int: ...
|
|
629
|
+
|
|
630
|
+
class StringIO(TextIOBase, _TextIOBase, TextIO): # type: ignore[misc] # incompatible definitions of write in the base classes
|
|
631
|
+
"""
|
|
632
|
+
Text I/O implementation using an in-memory buffer.
|
|
633
|
+
|
|
634
|
+
The initial_value argument sets the value of object. The newline
|
|
635
|
+
argument is like the one of TextIOWrapper's constructor.
|
|
636
|
+
"""
|
|
637
|
+
def __init__(self, initial_value: str | None = "", newline: str | None = "\n") -> None: ...
|
|
638
|
+
# StringIO does not contain a "name" field. This workaround is necessary
|
|
639
|
+
# to allow StringIO sub-classes to add this field, as it is defined
|
|
640
|
+
# as a read-only property on IO[].
|
|
641
|
+
name: Any
|
|
642
|
+
def getvalue(self) -> str:
|
|
643
|
+
"""Retrieve the entire contents of the object."""
|
|
644
|
+
...
|
|
645
|
+
@property
|
|
646
|
+
def line_buffering(self) -> bool: ...
|
|
647
|
+
def seek(self, pos: int, whence: int = 0, /) -> int:
|
|
648
|
+
"""
|
|
649
|
+
Change stream position.
|
|
650
|
+
|
|
651
|
+
Seek to character offset pos relative to position indicated by whence:
|
|
652
|
+
0 Start of stream (the default). pos should be >= 0;
|
|
653
|
+
1 Current position - pos must be 0;
|
|
654
|
+
2 End of stream - pos must be 0.
|
|
655
|
+
Returns the new absolute position.
|
|
656
|
+
"""
|
|
657
|
+
...
|
|
658
|
+
def truncate(self, pos: int | None = None, /) -> int:
|
|
659
|
+
"""
|
|
660
|
+
Truncate size to pos.
|
|
661
|
+
|
|
662
|
+
The pos argument defaults to the current file position, as
|
|
663
|
+
returned by tell(). The current file position is unchanged.
|
|
664
|
+
Returns the new absolute position.
|
|
665
|
+
"""
|
|
666
|
+
...
|
|
667
|
+
|
|
668
|
+
class IncrementalNewlineDecoder:
|
|
669
|
+
r"""
|
|
670
|
+
Codec used when reading a file in universal newlines mode.
|
|
671
|
+
|
|
672
|
+
It wraps another incremental decoder, translating \r\n and \r into \n.
|
|
673
|
+
It also records the types of newlines encountered. When used with
|
|
674
|
+
translate=False, it ensures that the newline sequence is returned in
|
|
675
|
+
one piece. When used with decoder=None, it expects unicode strings as
|
|
676
|
+
decode input and translates newlines without first invoking an external
|
|
677
|
+
decoder.
|
|
678
|
+
"""
|
|
679
|
+
def __init__(self, decoder: codecs.IncrementalDecoder | None, translate: bool, errors: str = "strict") -> None: ...
|
|
680
|
+
def decode(self, input: ReadableBuffer | str, final: bool = False) -> str: ...
|
|
681
|
+
@property
|
|
682
|
+
def newlines(self) -> str | tuple[str, ...] | None: ...
|
|
683
|
+
def getstate(self) -> tuple[bytes, int]: ...
|
|
684
|
+
def reset(self) -> None: ...
|
|
685
|
+
def setstate(self, state: tuple[bytes, int], /) -> None: ...
|
|
686
|
+
|
|
687
|
+
if sys.version_info >= (3, 10):
|
|
688
|
+
@overload
|
|
689
|
+
def text_encoding(encoding: None, stacklevel: int = 2, /) -> Literal["locale", "utf-8"]:
|
|
690
|
+
"""
|
|
691
|
+
A helper function to choose the text encoding.
|
|
692
|
+
|
|
693
|
+
When encoding is not None, this function returns it.
|
|
694
|
+
Otherwise, this function returns the default text encoding
|
|
695
|
+
(i.e. "locale" or "utf-8" depends on UTF-8 mode).
|
|
696
|
+
|
|
697
|
+
This function emits an EncodingWarning if encoding is None and
|
|
698
|
+
sys.flags.warn_default_encoding is true.
|
|
699
|
+
|
|
700
|
+
This can be used in APIs with an encoding=None parameter.
|
|
701
|
+
However, please consider using encoding="utf-8" for new APIs.
|
|
702
|
+
"""
|
|
703
|
+
...
|
|
704
|
+
@overload
|
|
705
|
+
def text_encoding(encoding: _T, stacklevel: int = 2, /) -> _T:
|
|
706
|
+
"""
|
|
707
|
+
A helper function to choose the text encoding.
|
|
708
|
+
|
|
709
|
+
When encoding is not None, this function returns it.
|
|
710
|
+
Otherwise, this function returns the default text encoding
|
|
711
|
+
(i.e. "locale" or "utf-8" depends on UTF-8 mode).
|
|
712
|
+
|
|
713
|
+
This function emits an EncodingWarning if encoding is None and
|
|
714
|
+
sys.flags.warn_default_encoding is true.
|
|
715
|
+
|
|
716
|
+
This can be used in APIs with an encoding=None parameter.
|
|
717
|
+
However, please consider using encoding="utf-8" for new APIs.
|
|
718
|
+
"""
|
|
719
|
+
...
|