Use assignment expressions 29 (#58713)

This commit is contained in:
Marc Mueller 2021-10-30 16:31:43 +02:00 committed by GitHub
parent 887d04be60
commit b1d49b3b66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 27 additions and 62 deletions

View file

@ -22,8 +22,7 @@ def normalize_metadata(metadata: dict) -> dict:
"""Normalize object metadata by stripping the prefix."""
new_metadata = {}
for meta_key, meta_value in metadata.items():
match = _METADATA_RE.match(meta_key)
if not match:
if not (match := _METADATA_RE.match(meta_key)):
continue
new_metadata[match.group(1).lower()] = meta_value