summaryrefslogtreecommitdiffstats
path: root/Lib/tomllib/_parser.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] gh-133117: Enable stricter mypy checks for `tomllib` (GH-133206) ↵Miss Islington (bot)2025-05-031-5/+5
| | | | | | | | (#133343) gh-133117: Enable stricter mypy checks for `tomllib` (GH-133206) (cherry picked from commit cb3174113e7dbb8a757ce64faac5a8c7e074945b) Co-authored-by: sobolevn <mail@sobolevn.me>
* [3.13] gh-133117: Run mypy on `tomllib` in CI (GH-133118) (#133192)Miss Islington (bot)2025-04-301-2/+2
| | | | | | gh-133117: Run mypy on `tomllib` in CI (GH-133118) (cherry picked from commit 5ea9010e8910cb97555c3aef4ed95cca93a74aab) Co-authored-by: sobolevn <mail@sobolevn.me>
* bpo-40059: Add tomllib (PEP-680) (GH-31498)Taneli Hukkinen2022-03-081-0/+691
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`