aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/common
diff options
context:
space:
mode:
authorGravatar Martin Wicke <wicke@google.com>2017-03-10 16:44:01 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-03-10 17:11:58 -0800
commit98620314c6391e4a292ffa545af5337c88ae3bfc (patch)
treea40dd6b4b47dac0c9b5d676055578b387185050a /tensorflow/tools/common
parentee8b0fe9ee6ef46f46b5517f57f6cf85ed13b978 (diff)
Add operators to classes in docs.
Enables all names looking like __XXXX__. It also excludes all the symbols defined in "uninteresting" base classes such as Exception, type, object, etc., as well as everything defined by protobuf, and methods (but not properties) defined by namedtuple. Sorts methods to have __init__ and __new__ first. Corrects links to _pb2.py files to point to .proto files instead. Removes redundant separate pages for class and static methods. Change: 149813108
Diffstat (limited to 'tensorflow/tools/common')
-rw-r--r--tensorflow/tools/common/public_api.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tensorflow/tools/common/public_api.py b/tensorflow/tools/common/public_api.py
index 9fa2babd60..3364ff6bc9 100644
--- a/tensorflow/tools/common/public_api.py
+++ b/tensorflow/tools/common/public_api.py
@@ -19,6 +19,7 @@ from __future__ import division
from __future__ import print_function
import inspect
+import re
class PublicAPIVisitor(object):
@@ -72,8 +73,9 @@ class PublicAPIVisitor(object):
def _isprivate(self, name):
"""Return whether a name is private."""
- # TODO(wicke): We have to almost certainly add more exceptions than init.
- return name.startswith('_') and name not in ['__init__']
+ # TODO(wicke): Find out what names to exclude.
+ return (name.startswith('_') and not re.match('__.*__$', name) or
+ name in ['__base__', '__class__'])
def _do_not_descend(self, path, name):
"""Safely queries if a specific fully qualified name should be excluded."""