Skip to content

Commit 58afd22

Browse files
committed
Drive-by: use zip_longest
1 parent 8fd7786 commit 58afd22

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

temporalio/converter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from dataclasses import dataclass
1616
from datetime import datetime
1717
from enum import IntEnum
18+
from itertools import zip_longest
1819
from typing import (
1920
Any,
2021
Awaitable,
@@ -291,10 +292,9 @@ def from_payloads(
291292
RuntimeError: Error during decode
292293
"""
293294
values = []
294-
for index, payload in enumerate(payloads):
295-
type_hint = None
296-
if type_hints and len(type_hints) > index:
297-
type_hint = type_hints[index]
295+
for index, (payload, type_hint) in enumerate(
296+
zip_longest(payloads, type_hints or [])
297+
):
298298
# Raw value should just wrap
299299
if type_hint == temporalio.common.RawValue:
300300
values.append(temporalio.common.RawValue(payload))

0 commit comments

Comments
 (0)