diff options
author | Steve Frécinaux <code@istique.net> | 2008-09-06 00:35:04 +0200 |
---|---|---|
committer | Steve Frécinaux <code@istique.net> | 2008-09-06 00:35:04 +0200 |
commit | c8c50d8be2dc5ae74e53e44a87f580bf25956af9 (patch) | |
tree | 39348788be4e9acf31abcf4d81e391cdd9183304 /lib/git/tree.py | |
parent | 2f6a6e35d003c243968cdb41b72fbbe609e56841 (diff) | |
download | gitpython-c8c50d8be2dc5ae74e53e44a87f580bf25956af9.tar.gz |
Do not use **kwargs for constructors.
It is better to have an explicit list of variables for the constructors,
be it only to avoid mispelled arguments.
Diffstat (limited to 'lib/git/tree.py')
-rw-r--r-- | lib/git/tree.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/git/tree.py b/lib/git/tree.py index 59d3af1e..dbd78ac4 100644 --- a/lib/git/tree.py +++ b/lib/git/tree.py @@ -9,17 +9,14 @@ from lazy import LazyMixin import blob class Tree(LazyMixin): - def __init__(self, repo, **kwargs): + def __init__(self, repo, id, mode=None, name=None): LazyMixin.__init__(self) self.repo = repo - self.id = None - self.mode = None - self.name = None + self.id = id + self.mode = mode + self.name = name self._contents = None - for k, v in kwargs.items(): - setattr(self, k, v) - def __bake__(self): # Ensure the treeish references directly a tree treeish = self.id |