PY-17183 Heuristically determine when incomplete docstring captures another declaration

To do so I search for the line inside a docstring that starts with
either "def " or "class " and has indentation less than that of opening
docstring quotes.
This commit is contained in:
Mikhail Golubev
2015-10-25 15:49:43 +03:00
parent 05ecadf9db
commit 40733b0fd4
10 changed files with 123 additions and 10 deletions
@@ -0,0 +1,12 @@
def f():
"""
Returns:
"""
class Class:
"""
bar
"""
@@ -0,0 +1,8 @@
def f():
"""<caret>
class Class:
"""
bar
"""
@@ -0,0 +1,12 @@
def f():
"""
Returns:
"""
def g():
"""
bar
"""
@@ -0,0 +1,8 @@
def f():
"""<caret>
def g():
"""
bar
"""
@@ -0,0 +1,15 @@
def f():
"""
Monospaced ``func`` and func
Example:
::
def func():
pass
class Class():
pass
"""
@@ -0,0 +1,14 @@
def f():
"""<caret>
Monospaced ``func`` and func
Example:
::
def func():
pass
class Class():
pass
"""