Skip to content

Commit 9ec2709

Browse files
committed
Unnecessary generator - rewrite as a dict comprehension
1 parent db0dfa0 commit 9ec2709

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: git/cmd.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def dashify(string):
125125

126126

127127
def slots_to_dict(self, exclude=()):
128-
return dict((s, getattr(self, s)) for s in self.__slots__ if s not in exclude)
128+
return {s: getattr(self, s) for s in self.__slots__ if s not in exclude}
129129

130130

131131
def dict_to_slots_and__excluded_are_none(self, d, excluded=()):
@@ -972,8 +972,8 @@ def _call_process(self, method, *args, **kwargs):
972972
:return: Same as ``execute``"""
973973
# Handle optional arguments prior to calling transform_kwargs
974974
# otherwise these'll end up in args, which is bad.
975-
exec_kwargs = dict((k, v) for k, v in kwargs.items() if k in execute_kwargs)
976-
opts_kwargs = dict((k, v) for k, v in kwargs.items() if k not in execute_kwargs)
975+
exec_kwargs = {k: v for k, v in kwargs.items() if k in execute_kwargs}
976+
opts_kwargs = {k: v for k, v in kwargs.items() if k not in execute_kwargs}
977977

978978
insert_after_this_arg = opts_kwargs.pop('insert_kwargs_after', None)
979979

0 commit comments

Comments
 (0)