[New-bugs-announce] [issue23217] help() function incorrectly captures comment preceding a nested function

Raymond Hettinger report at bugs.python.org
Sat Jan 10 10:33:16 CET 2015


New submission from Raymond Hettinger:

The help() function mysteriously captures a comment on the line preceding an inner function definition in a nested scope.

Given this code:
----------------

    def outer(func):
        #comment
        def inner():
            return
        return inner

    @outer
    def f():
        return


Calling help(f) produces:
-------------------------

    Help on function inner in module __main__:

    inner()
        #comment

----------
components: Library (Lib)
messages: 233811
nosy: rhettinger
priority: normal
severity: normal
status: open
title: help() function incorrectly captures comment preceding a nested function
type: behavior
versions: Python 3.2, Python 3.3, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23217>
_______________________________________


More information about the New-bugs-announce mailing list