-
-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
When using tomlkit to modify a tomldocument, mypy throws a bunch of errors that I don't know how to fix.
Example:
import tomlkit
from pathlib import Path
path = Path("data.toml")
path.write_text("""
[foo]
bar = 'baz'
[foo.bla]
blub = 'blib'
""")
data = tomlkit.parse(path.read_text(encoding="utf-8"))
data["foo"]["bar"] = "quux"
data["foo"]["bla"]["blub"] = "bleb"
path.write_bytes(tomlkit.dumps(data).encode("utf-8"))
Output
tomlkit_issue.py:14: error: Unsupported target for indexed assignment ("Item | Container") [index]
tomlkit_issue.py:15: error: Value of type "Item | Container" is not indexable [index]
tomlkit_issue.py:15: error: Unsupported target for indexed assignment ("Any | Item | Container") [index]
Found 3 errors in 1 file (checked 1 source file)
Is there any fix for this?
Any help is greatly appreciated :)
LunkRat, jonathan-scholbach, waketzheng, skeggse and vtsao-openai
Metadata
Metadata
Assignees
Labels
No labels