Repository navigation
🪨 Any shape
The first example in our docs loads a mapping and reads a key. Run a type checker over it, and it failed. Not great for a first impression.
loads, load, async_loads, and async_load promised a closed union: a dict, a list, a string, a number, a document, or None. A type checker cannot know which one your file holds, so it refused loads(text)["key"] until you added a cast() or an isinstance check. The union was not even complete: it left out the dates from OPT_TIMESTAMPS and anything your own tag handlers return.
v0.7.1 types them as returning Any, the same as json.loads, orjson, and PyYAML's stubs. Your code type-checks again, and nothing changes at runtime. Thanks to @claudioc-sisal for the clear report!
pip install yamlrocks📚 Docs: https://yaml.rocks
Same rock. Any shape. 🪨
../Frenck
Blogging my personal ramblings at frenck.dev
What's changed
🐛 Bug fixes
⬆️ Dependency updates
23 changes
- ⬆️ Update dependency python to v3.15.0 @renovate[bot] (#490)
- ⬆️ Update dependency hypothesis to v6.169.1 @renovate[bot] (#493)
- ⬆️ Update dependency ty to v0.0.87 @renovate[bot] (#492)
- ⬆️ Update python:3.15-alpine Docker digest to ff4d3c9 @renovate[bot] (#495)
- ⬆️ Update dependency node to v24.22.0 @renovate[bot] (#498)
- ⬆️ Update CodSpeedHQ/action action to v5.5.0 @renovate[bot] (#497)
- ⬆️ Update python:3.15-slim Docker digest to f48fda6 @renovate[bot] (#496)
- ⬆️ Update dependency node to v24.22.0 @renovate[bot] (#501)
- ⬆️ Update dependency hypothesis to v6.169.3 @renovate[bot] (#500)
- ⬆️ Update dependency ty to v0.0.88 @renovate[bot] (#504)
- ⬆️ Update dependency @astrojs/markdown-remark to v7.3.3 @renovate[bot] (#505)
- ⬆️ Update dependency astro to v7.4.0 @renovate[bot] (#507)
- ⬆️ Update dependency hypothesis to v6.170.0 @renovate[bot] (#503)
- ⬆️ Update github/codeql-action action to v4.39.0 @renovate[bot] (#509)
- ⬆️ Update dependency ruff to v0.17.1 @renovate[bot] (#506)
- ⬆️ Update dependency pluggy to v1.7.0 @renovate[bot] (#508)
- ⬆️ Update dependency zizmor to v1.31.1 @renovate[bot] (#502)
- ⬆️ Update dependency rust-just to v1.59.0 @renovate[bot] (#510)
- ⬆️ Update dependency ty to v0.0.89 @renovate[bot] (#511)
- ⬆️ Update Rust crate pyo3 to 0.30 @renovate[bot] (#499)
- ⬆️ Update dependency hypothesis to v6.170.1 @renovate[bot] (#512)
- ⬆️ Update python:3.15-slim Docker digest to d802f03 @renovate[bot] (#515)
- ⬆️ Update Rust crate libc to v0.2.191 @renovate[bot] (#513)