Use set & dict literals (#33636)

Co-authored-by: Daniel Høyer Iversen <mail@dahoiv.net>
This commit is contained in:
Franck Nijhof 2020-04-04 20:05:15 +02:00 committed by GitHub
parent d85222ad80
commit 7d3c974747
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 89 additions and 80 deletions

View file

@ -659,9 +659,9 @@ class GTFSDepartureSensor(Entity):
@staticmethod
def dict_for_table(resource: Any) -> dict:
"""Return a dictionary for the SQLAlchemy resource given."""
return dict(
(col, getattr(resource, col)) for col in resource.__table__.columns.keys()
)
return {
col: getattr(resource, col) for col in resource.__table__.columns.keys()
}
def append_keys(self, resource: dict, prefix: Optional[str] = None) -> None:
"""Properly format key val pairs to append to attributes."""