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

Unified Diff: mojo/devtools/common/devtoolslib/utils.py

Issue 1259773004: Add docstring inheritance decorator and drop duplicated docstrings. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 4 months 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 | « mojo/devtools/common/devtoolslib/linux_shell.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/devtools/common/devtoolslib/utils.py
diff --git a/mojo/devtools/common/devtoolslib/utils.py b/mojo/devtools/common/devtoolslib/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..7bf2e1c641221f2d89e25022c7301a10b5d8a4b8
--- /dev/null
+++ b/mojo/devtools/common/devtoolslib/utils.py
@@ -0,0 +1,16 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Python utils."""
+
+
+def overrides(parent_class):
+ """Inherits the docstring from the method of the same name in the indicated
+ parent class.
+ """
+ def overriding(method):
+ assert(method.__name__ in dir(parent_class))
+ method.__doc__ = getattr(parent_class, method.__name__).__doc__
+ return method
+ return overriding
« no previous file with comments | « mojo/devtools/common/devtoolslib/linux_shell.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698