Title: bpo-40059: tomllib by hukkin · Pull Request #31498 · python/cpython · GitHub
Open Graph Title: bpo-40059: tomllib by hukkin · Pull Request #31498 · python/cpython
X Title: bpo-40059: tomllib by hukkin · Pull Request #31498 · python/cpython
Description: 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 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: import unittest from . import load_tests unittest.main() Add the following to Lib/test/test_tomllib/__init__.py: 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 edit: For reference, there's one more step – Add tomllib to Makefile.pre.in https://bugs.python.org/issue40059
Open Graph Description: 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: h...
X Description: 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: h...
Opengraph URL: https://github.com/python/cpython/pull/31498
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:a5ae3e58-3fea-3fc3-7638-afca1df09d1d |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | D670:8F2D5:1F513A9:2BFEA78:696A5B8F |
| html-safe-nonce | 1c4962ccddfcfb35f71bbf7d0f524792fca4028d2c095cc4a94eef5e1a3b5807 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENjcwOjhGMkQ1OjFGNTEzQTk6MkJGRUE3ODo2OTZBNUI4RiIsInZpc2l0b3JfaWQiOiIyOTI5MjM4ODgxMTY1ODc0MDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 99886491c58aa81843f4954ffb433d87883e4d8139e6a9c933406f5a7158d5f3 |
| hovercard-subject-tag | pull_request:860426761 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/31498/checks |
| twitter:image | https://avatars.githubusercontent.com/u/3275109?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3275109?s=400&v=4 |
| og:image:alt | 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: h... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width