diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-06-07 23:47:15 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-06-07 23:47:15 (GMT) |
commit | 9d19da701db80aff583c98fd3278b4f871fc2e05 (patch) | |
tree | ca452e3fe8badbb79b89f9e54aed8c8a5bc7b53c /Lib/pydoc.py | |
parent | edb07d28fbfd526f0771b337b05c2e611d266981 (diff) | |
parent | ed1160b39c23c4b035b6c203cc6df53274d08939 (diff) | |
download | cpython-9d19da701db80aff583c98fd3278b4f871fc2e05.zip cpython-9d19da701db80aff583c98fd3278b4f871fc2e05.tar.gz cpython-9d19da701db80aff583c98fd3278b4f871fc2e05.tar.bz2 |
merge 3.4 (#13223)
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 42f65dc..cb65aef 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -593,10 +593,15 @@ class HTMLDoc(Doc): elif pep: url = 'http://www.python.org/dev/peps/pep-%04d/' % int(pep) results.append('<a href="%s">%s</a>' % (url, escape(all))) + elif selfdot: + # Create a link for methods like 'self.method(...)' + # and use <strong> for attributes like 'self.attr' + if text[end:end+1] == '(': + results.append('self.' + self.namelink(name, methods)) + else: + results.append('self.<strong>%s</strong>' % name) elif text[end:end+1] == '(': results.append(self.namelink(name, methods, funcs, classes)) - elif selfdot: - results.append('self.<strong>%s</strong>' % name) else: results.append(self.namelink(name, classes)) here = end |