Skip to content

Commit

Permalink
type: fix type for add function
Browse files Browse the repository at this point in the history
  • Loading branch information
hollandjg committed Jun 14, 2024
1 parent d6f1c36 commit 003f2ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/autora/state_history_freeform.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from collections import UserList
from functools import singledispatchmethod
from typing import List, Union
from typing import List

from autora.state import Delta
from autora.state_history_dataclass import Entry


Expand All @@ -17,6 +16,7 @@ class HistoryStateList(UserList):
>>> a + {"conditions": [1, 2, 3]}
[Entry(kind='conditions', data=[1, 2, 3])]
>>> from autora.state import Delta
>>> a + Delta(conditions=[1, 2, 3])
[Entry(kind='conditions', data=[1, 2, 3])]
Expand Down Expand Up @@ -60,7 +60,7 @@ def _(self, other: Entry):
return new

@__add__.register
def _(self, other: Union[Delta, dict]):
def _(self, other: dict):
new_data = [Entry(kind, data) for kind, data in other.items()]
new = self + new_data
return new
Expand Down

0 comments on commit 003f2ad

Please sign in to comment.