Skip to content

Commit eb6d82f

Browse files
committed
refactor to use dict union, instead of unpacking
Signed-off-by: NicholasTanz <nicholastanzillo@gmail.com>
1 parent 5c71f4f commit eb6d82f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tuf/api/_payload.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,19 +343,17 @@ def verified(self) -> bool:
343343
def signed(self) -> dict[str, Key]:
344344
"""Dictionary of all signing keys that have signed, from both
345345
VerificationResults.
346-
return a union of all signed (in python<3.9 this requires
347-
dict unpacking)
346+
return a union of all signed.
348347
"""
349-
return {**self.first.signed, **self.second.signed}
348+
return self.first.signed | self.second.signed
350349

351350
@property
352351
def unsigned(self) -> dict[str, Key]:
353352
"""Dictionary of all signing keys that have not signed, from both
354353
VerificationResults.
355-
return a union of all unsigned (in python<3.9 this requires
356-
dict unpacking)
354+
return a union of all unsigned.
357355
"""
358-
return {**self.first.unsigned, **self.second.unsigned}
356+
return self.first.unsigned | self.second.unsigned
359357

360358

361359
class _DelegatorMixin(metaclass=abc.ABCMeta):

0 commit comments

Comments
 (0)