Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Unified Diff: appengine/findit/libs/gitiles/blame.py

Issue 2607613002: Converting Region class to a namedtuple (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/findit/crash/changelist_classifier.py ('k') | appengine/findit/libs/gitiles/change_log.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/libs/gitiles/blame.py
diff --git a/appengine/findit/libs/gitiles/blame.py b/appengine/findit/libs/gitiles/blame.py
index 138edf16e77ce4d3f19c5ba666dbd9388f0208a5..f97ba8eea2dea3ca1d93a186dc6667a14913b504 100644
--- a/appengine/findit/libs/gitiles/blame.py
+++ b/appengine/findit/libs/gitiles/blame.py
@@ -2,17 +2,14 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+from collections import namedtuple
-class Region(object):
+
+class Region(namedtuple('Region',
+ ['start', 'count', 'revision', 'author_name', 'author_email',
+ 'author_time'])):
"""A region of some (unspecified) file at a (known) revision."""
- def __init__(self, start, count, revision,
- author_name, author_email, author_time):
- self.start = start
- self.count = count
- self.revision = revision
- self.author_name = author_name
- self.author_email = author_email
- self.author_time = author_time
+ __slots__ = ()
def ToDict(self):
return {
« no previous file with comments | « appengine/findit/crash/changelist_classifier.py ('k') | appengine/findit/libs/gitiles/change_log.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698