diff --git a/lib/_range.py b/lib/_range.py index ee9c329e..c1facc0f 100644 --- a/lib/_range.py +++ b/lib/_range.py @@ -181,11 +181,8 @@ class Range(object): return self.__gt__(other) def __getstate__(self): - return dict( - (slot, getattr(self, slot)) - for slot in self.__slots__ - if hasattr(self, slot) - ) + return {slot: getattr(self, slot) + for slot in self.__slots__ if hasattr(self, slot)} def __setstate__(self, state): for slot, value in state.items(): diff --git a/lib/extensions.py b/lib/extensions.py index 91b81331..d15f76c9 100644 --- a/lib/extensions.py +++ b/lib/extensions.py @@ -163,7 +163,7 @@ def make_dsn(dsn=None, **kwargs): kwargs['dbname'] = kwargs.pop('database') # Drop the None arguments - kwargs = dict((k, v) for (k, v) in kwargs.iteritems() if v is not None) + kwargs = {k: v for (k, v) in kwargs.iteritems() if v is not None} if dsn is not None: tmp = parse_dsn(dsn)