mm21 / trilium-alchemy

Python SDK and CLI toolkit for Trilium Notes
GNU Affero General Public License v3.0
10 stars 1 forks source link

[bug] Typing hint for adding multiple attributes incorrect #2

Closed jwhonce closed 1 year ago

jwhonce commented 1 year ago
   task = Note(...)
    task += [Label("tag", t) for t in tags or []]

Works as expected but vscode displays

Operator "+=" not supported for types "Note" and "list[Label]"
Operator "+" not supported for types "Note" and "list[Label]"
jwhonce commented 1 year ago

The Note.content field also reports a type error when assigned a string. Code works as expected.

mm21 commented 1 year ago

Thanks for catching this. The += operator should be fixed by #1 - I think it's because __iadd__ wasn't returning a Note type.