mirror of
https://github.com/python/cpython.git
synced 2024-11-30 13:24:13 +08:00
591f6754b5
This adds a new standard library module, `tomllib`, for parsing TOML. The implementation is based on Tomli (https://github.com/hukkin/tomli). ## Steps taken (converting `tomli` to `tomllib`) - Move everything in `tomli:src/tomli` to `Lib/tomllib`. Exclude `py.typed`. - Remove `__version__ = ...` line from `Lib/tomllib/__init__.py` - Move everything in `tomli:tests` to `Lib/test/test_tomllib`. Exclude the following test data dirs recursively: - `tomli:tests/data/invalid/_external/` - `tomli:tests/data/valid/_external/` - Create `Lib/test/test_tomllib/__main__.py`: ```python import unittest from . import load_tests unittest.main() ``` - Add the following to `Lib/test/test_tomllib/__init__.py`: ```python import os from test.support import load_package_tests def load_tests(*args): return load_package_tests(os.path.dirname(__file__), *args) ``` Also change `import tomli as tomllib` to `import tomllib`. - In `cpython/Lib/tomllib/_parser.py` replace `__fp` with `fp` and `__s` with `s`. Add the `/` to `load` and `loads` function signatures. - Run `make regen-stdlib-module-names` - Create `Doc/library/tomllib.rst` and reference it in `Doc/library/fileformats.rst`
311 lines
3.5 KiB
C
Generated
311 lines
3.5 KiB
C
Generated
// Auto-generated by Tools/scripts/generate_stdlib_module_names.py.
|
|
// List used to create sys.stdlib_module_names.
|
|
|
|
static const char* _Py_stdlib_module_names[] = {
|
|
"__future__",
|
|
"_abc",
|
|
"_aix_support",
|
|
"_ast",
|
|
"_asyncio",
|
|
"_bisect",
|
|
"_blake2",
|
|
"_bootsubprocess",
|
|
"_bz2",
|
|
"_codecs",
|
|
"_codecs_cn",
|
|
"_codecs_hk",
|
|
"_codecs_iso2022",
|
|
"_codecs_jp",
|
|
"_codecs_kr",
|
|
"_codecs_tw",
|
|
"_collections",
|
|
"_collections_abc",
|
|
"_compat_pickle",
|
|
"_compression",
|
|
"_contextvars",
|
|
"_crypt",
|
|
"_csv",
|
|
"_ctypes",
|
|
"_curses",
|
|
"_curses_panel",
|
|
"_datetime",
|
|
"_dbm",
|
|
"_decimal",
|
|
"_elementtree",
|
|
"_frozen_importlib",
|
|
"_frozen_importlib_external",
|
|
"_functools",
|
|
"_gdbm",
|
|
"_hashlib",
|
|
"_heapq",
|
|
"_imp",
|
|
"_io",
|
|
"_json",
|
|
"_locale",
|
|
"_lsprof",
|
|
"_lzma",
|
|
"_markupbase",
|
|
"_md5",
|
|
"_msi",
|
|
"_multibytecodec",
|
|
"_multiprocessing",
|
|
"_opcode",
|
|
"_operator",
|
|
"_osx_support",
|
|
"_overlapped",
|
|
"_pickle",
|
|
"_posixshmem",
|
|
"_posixsubprocess",
|
|
"_py_abc",
|
|
"_pydecimal",
|
|
"_pyio",
|
|
"_queue",
|
|
"_random",
|
|
"_scproxy",
|
|
"_sha1",
|
|
"_sha256",
|
|
"_sha3",
|
|
"_sha512",
|
|
"_signal",
|
|
"_sitebuiltins",
|
|
"_socket",
|
|
"_sqlite3",
|
|
"_sre",
|
|
"_ssl",
|
|
"_stat",
|
|
"_statistics",
|
|
"_string",
|
|
"_strptime",
|
|
"_struct",
|
|
"_symtable",
|
|
"_thread",
|
|
"_threading_local",
|
|
"_tkinter",
|
|
"_tokenize",
|
|
"_tracemalloc",
|
|
"_typing",
|
|
"_uuid",
|
|
"_warnings",
|
|
"_weakref",
|
|
"_weakrefset",
|
|
"_winapi",
|
|
"_zoneinfo",
|
|
"abc",
|
|
"aifc",
|
|
"antigravity",
|
|
"argparse",
|
|
"array",
|
|
"ast",
|
|
"asynchat",
|
|
"asyncio",
|
|
"asyncore",
|
|
"atexit",
|
|
"audioop",
|
|
"base64",
|
|
"bdb",
|
|
"binascii",
|
|
"bisect",
|
|
"builtins",
|
|
"bz2",
|
|
"cProfile",
|
|
"calendar",
|
|
"cgi",
|
|
"cgitb",
|
|
"chunk",
|
|
"cmath",
|
|
"cmd",
|
|
"code",
|
|
"codecs",
|
|
"codeop",
|
|
"collections",
|
|
"colorsys",
|
|
"compileall",
|
|
"concurrent",
|
|
"configparser",
|
|
"contextlib",
|
|
"contextvars",
|
|
"copy",
|
|
"copyreg",
|
|
"crypt",
|
|
"csv",
|
|
"ctypes",
|
|
"curses",
|
|
"dataclasses",
|
|
"datetime",
|
|
"dbm",
|
|
"decimal",
|
|
"difflib",
|
|
"dis",
|
|
"distutils",
|
|
"doctest",
|
|
"email",
|
|
"encodings",
|
|
"ensurepip",
|
|
"enum",
|
|
"errno",
|
|
"faulthandler",
|
|
"fcntl",
|
|
"filecmp",
|
|
"fileinput",
|
|
"fnmatch",
|
|
"fractions",
|
|
"ftplib",
|
|
"functools",
|
|
"gc",
|
|
"genericpath",
|
|
"getopt",
|
|
"getpass",
|
|
"gettext",
|
|
"glob",
|
|
"graphlib",
|
|
"grp",
|
|
"gzip",
|
|
"hashlib",
|
|
"heapq",
|
|
"hmac",
|
|
"html",
|
|
"http",
|
|
"idlelib",
|
|
"imaplib",
|
|
"imghdr",
|
|
"imp",
|
|
"importlib",
|
|
"inspect",
|
|
"io",
|
|
"ipaddress",
|
|
"itertools",
|
|
"json",
|
|
"keyword",
|
|
"lib2to3",
|
|
"linecache",
|
|
"locale",
|
|
"logging",
|
|
"lzma",
|
|
"mailbox",
|
|
"mailcap",
|
|
"marshal",
|
|
"math",
|
|
"mimetypes",
|
|
"mmap",
|
|
"modulefinder",
|
|
"msilib",
|
|
"msvcrt",
|
|
"multiprocessing",
|
|
"netrc",
|
|
"nis",
|
|
"nntplib",
|
|
"nt",
|
|
"ntpath",
|
|
"nturl2path",
|
|
"numbers",
|
|
"opcode",
|
|
"operator",
|
|
"optparse",
|
|
"os",
|
|
"ossaudiodev",
|
|
"pathlib",
|
|
"pdb",
|
|
"pickle",
|
|
"pickletools",
|
|
"pipes",
|
|
"pkgutil",
|
|
"platform",
|
|
"plistlib",
|
|
"poplib",
|
|
"posix",
|
|
"posixpath",
|
|
"pprint",
|
|
"profile",
|
|
"pstats",
|
|
"pty",
|
|
"pwd",
|
|
"py_compile",
|
|
"pyclbr",
|
|
"pydoc",
|
|
"pydoc_data",
|
|
"pyexpat",
|
|
"queue",
|
|
"quopri",
|
|
"random",
|
|
"re",
|
|
"readline",
|
|
"reprlib",
|
|
"resource",
|
|
"rlcompleter",
|
|
"runpy",
|
|
"sched",
|
|
"secrets",
|
|
"select",
|
|
"selectors",
|
|
"shelve",
|
|
"shlex",
|
|
"shutil",
|
|
"signal",
|
|
"site",
|
|
"smtpd",
|
|
"smtplib",
|
|
"sndhdr",
|
|
"socket",
|
|
"socketserver",
|
|
"spwd",
|
|
"sqlite3",
|
|
"sre_compile",
|
|
"sre_constants",
|
|
"sre_parse",
|
|
"ssl",
|
|
"stat",
|
|
"statistics",
|
|
"string",
|
|
"stringprep",
|
|
"struct",
|
|
"subprocess",
|
|
"sunau",
|
|
"symtable",
|
|
"sys",
|
|
"sysconfig",
|
|
"syslog",
|
|
"tabnanny",
|
|
"tarfile",
|
|
"telnetlib",
|
|
"tempfile",
|
|
"termios",
|
|
"textwrap",
|
|
"this",
|
|
"threading",
|
|
"time",
|
|
"timeit",
|
|
"tkinter",
|
|
"token",
|
|
"tokenize",
|
|
"tomllib",
|
|
"trace",
|
|
"traceback",
|
|
"tracemalloc",
|
|
"tty",
|
|
"turtle",
|
|
"turtledemo",
|
|
"types",
|
|
"typing",
|
|
"unicodedata",
|
|
"unittest",
|
|
"urllib",
|
|
"uu",
|
|
"uuid",
|
|
"venv",
|
|
"warnings",
|
|
"wave",
|
|
"weakref",
|
|
"webbrowser",
|
|
"winreg",
|
|
"winsound",
|
|
"wsgiref",
|
|
"xdrlib",
|
|
"xml",
|
|
"xmlrpc",
|
|
"zipapp",
|
|
"zipfile",
|
|
"zipimport",
|
|
"zlib",
|
|
"zoneinfo",
|
|
};
|