Skip to content

Commit

Permalink
Add misc type hint fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
smkent committed Nov 19, 2022
1 parent 2312a9f commit b6cc281
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jmapc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def request(
"multiple JMAP request methods"
)

calls_list = calls if isinstance(calls, list) else [calls]
calls_list = calls if isinstance(calls, Sequence) else [calls]
method_calls: List[Invocation] = []
# Create Invocations for Methods
for i, c in enumerate(calls_list):
Expand Down
2 changes: 1 addition & 1 deletion jmapc/methods/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class Set(MethodWithAccount, SetMethod):
if_in_state: Optional[StrOrRef] = None
create: Optional[Dict[str, Any]] = None
update: Optional[Dict[str, Dict[str, Any]]] = None
destroy: Optional[ListOrRef] = None
destroy: Optional[ListOrRef[str]] = None


@dataclass
Expand Down
4 changes: 2 additions & 2 deletions jmapc/models/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class EmailBodyValue(Model):
@dataclass
class EmailQueryFilterCondition(Model):
in_mailbox: Optional[StrOrRef] = None
in_mailbox_other_than: Optional[ListOrRef] = None
in_mailbox_other_than: Optional[ListOrRef[str]] = None
before: Optional[datetime] = field(
default=None,
metadata=config(encoder=datetime_encode, decoder=datetime_decode),
Expand All @@ -104,7 +104,7 @@ class EmailQueryFilterCondition(Model):
cc: Optional[StrOrRef] = None
bcc: Optional[StrOrRef] = None
body: Optional[StrOrRef] = None
header: Optional[ListOrRef] = None
header: Optional[ListOrRef[str]] = None


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion tests/test_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TestModel(Model):
def test_serialize_result_reference() -> None:
@dataclass
class TestModel(Model):
ids: ListOrRef
ids: ListOrRef[str]

d = TestModel(
ids=ResultReference(
Expand Down

0 comments on commit b6cc281

Please sign in to comment.