Closed waketzheng closed 5 months ago
Mini demo to check result:
from pathlib import Path
import tomlkit
doc = tomlkit.parse(Path('pyproject.toml').read_text())
poetry_conf = doc['tool']['poetry']
print(poetry_conf)
poetry_conf['version'] = '0'
But that is not right, you can't assume an abitrary item is a table.
You can't make that assumption in vanilla python either:
doc: dict[str, Any] = get_data()
print(doc['tool']['abc']) # what type is doc['tool']?
Instead, you have to tell the typechecker the type information.
Fixes #326