summaryrefslogtreecommitdiff
path: root/git/util.py
diff options
context:
space:
mode:
authorHugo <hugovk@users.noreply.github.com>2018-03-18 21:33:18 +0200
committerHugo <hugovk@users.noreply.github.com>2018-03-18 22:26:31 +0200
commitac4f7d34f8752ab78949efcaa9f0bd938df33622 (patch)
tree0c7acd1d3c1e0012d26d610c7a9fe81197e28a5e /git/util.py
parent14582df679a011e8c741eb5dcd8126f883e1bc71 (diff)
downloadgitpython-ac4f7d34f8752ab78949efcaa9f0bd938df33622.tar.gz
Rewrite unnecessary dict/list/tuple calls as literals
Diffstat (limited to 'git/util.py')
-rw-r--r--git/util.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/git/util.py b/git/util.py
index 688ead39..1186d311 100644
--- a/git/util.py
+++ b/git/util.py
@@ -369,7 +369,7 @@ class RemoteProgress(object):
re_op_relative = re.compile(r"(remote: )?([\w\s]+):\s+(\d+)% \((\d+)/(\d+)\)(.*)")
def __init__(self):
- self._seen_ops = list()
+ self._seen_ops = []
self._cur_line = None
self.error_lines = []
self.other_lines = []
@@ -392,7 +392,7 @@ class RemoteProgress(object):
return []
sub_lines = line.split('\r')
- failed_lines = list()
+ failed_lines = []
for sline in sub_lines:
# find escape characters and cut them away - regex will not work with
# them as they are non-ascii. As git might expect a tty, it will send them
@@ -670,7 +670,7 @@ class Stats(object):
"""Create a Stat object from output retrieved by git-diff.
:return: git.Stat"""
- hsh = {'total': {'insertions': 0, 'deletions': 0, 'lines': 0, 'files': 0}, 'files': dict()}
+ hsh = {'total': {'insertions': 0, 'deletions': 0, 'lines': 0, 'files': 0}, 'files': {}}
for line in text.splitlines():
(raw_insertions, raw_deletions, filename) = line.split("\t")
insertions = raw_insertions != '-' and int(raw_insertions) or 0
@@ -917,7 +917,7 @@ class Iterable(object):
"""Defines an interface for iterable items which is to assure a uniform
way to retrieve and iterate items within the git repository"""
- __slots__ = tuple()
+ __slots__ = ()
_id_attribute_ = "attribute that most suitably identifies your instance"
@classmethod