Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
This adds a new standard library module,
tomllib
, for parsing TOML. The recently accepted PEP 680 -- tomllib is relevant here.This PR has already seen some review in a PR under my personal fork: hukkin#2 (thanks to @encukou, @merwok, @hauntsaninja, @JelleZijlstra (I hope I'm not forgetting anyone)).
The implementation is based on Tomli which I plan to keep maintaining as a backport for Python versions 3.7, 3.8, 3.9 and 3.10, until finally Python 3.10 goes EOL.
Steps taken (converting
tomli
totomllib
)Move everything in
tomli:src/tomli
toLib/tomllib
. Excludepy.typed
.Remove
__version__ = ...
line fromLib/tomllib/__init__.py
Move everything in
tomli:tests
toLib/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
:Add the following to
Lib/test/test_tomllib/__init__.py
:Also change
import tomli as tomllib
toimport tomllib
.In
cpython/Lib/tomllib/_parser.py
replace__fp
withfp
and__s
withs
. Add the/
toload
andloads
function signatures.Run
make regen-stdlib-module-names
Create
Doc/library/tomllib.rst
and reference it inDoc/library/fileformats.rst
https://bugs.python.org/issue40059
The text was updated successfully, but these errors were encountered: