New submission from David Mc Dougall <dam1...@g.rit.edu>:

My inline comment ('#') got picked up by the help command.

Write the following code to a file (I named it "reproducer.py"):

"""

class Foo:
    # Hello docstring, I'm a '#' comment!
    def bar(self):
        pass

assert Foo.bar.__doc__ is None
help(Foo.bar)

"""

The bug only happens when the file is executed.
$ python3 reproducer.py

Help on function bar in module __main__:

bar(self)
    # Hello docstring, I'm a '#' comment!


Evaluating it at the interactive prompt does not reproduce the bug.
$ cat reproducer.py | python3

Help on function bar in module __main__:

bar(self)

----------
messages: 411218
nosy: dam1784
priority: normal
severity: normal
status: open
title: help function reads comments
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46466>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to