diff options
author | Hugo <hugovk@users.noreply.github.com> | 2018-03-18 21:56:37 +0200 |
---|---|---|
committer | Hugo <hugovk@users.noreply.github.com> | 2018-03-18 22:26:31 +0200 |
commit | 9ec27096fbe036a97ead869c7522262f63165e1e (patch) | |
tree | a3242dc42440ccfd4c30d253d7296dc8410cba5f /git/cmd.py | |
parent | db0dfa07e34ed80bfe0ce389da946755ada13c5d (diff) | |
download | gitpython-9ec27096fbe036a97ead869c7522262f63165e1e.tar.gz |
Unnecessary generator - rewrite as a dict comprehension
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -125,7 +125,7 @@ def dashify(string): def slots_to_dict(self, exclude=()): - return dict((s, getattr(self, s)) for s in self.__slots__ if s not in exclude) + return {s: getattr(self, s) for s in self.__slots__ if s not in exclude} def dict_to_slots_and__excluded_are_none(self, d, excluded=()): @@ -972,8 +972,8 @@ class Git(LazyMixin): :return: Same as ``execute``""" # Handle optional arguments prior to calling transform_kwargs # otherwise these'll end up in args, which is bad. - exec_kwargs = dict((k, v) for k, v in kwargs.items() if k in execute_kwargs) - opts_kwargs = dict((k, v) for k, v in kwargs.items() if k not in execute_kwargs) + exec_kwargs = {k: v for k, v in kwargs.items() if k in execute_kwargs} + opts_kwargs = {k: v for k, v in kwargs.items() if k not in execute_kwargs} insert_after_this_arg = opts_kwargs.pop('insert_kwargs_after', None) |