Ticket #81 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

don't print out docstrings

Reported by: akaihola Assigned to:
Priority: moderate Keywords: docstring
Cc:

Description

def f():
    "This is a docstring"
    return 'This is a return value'

print f()
'This is a docstring'
This is a return value

This is a minor annoyance when pasting code with doctests into worksheets.

Change History

04/02/09 23:19:29 changed by otaylor

  • status changed from new to closed.
  • resolution set to fixed.

Yeah, that definitely isn't right. Fixed in:

http://git.fishsoup.net/cgit/reinteract/commit/?id=73a3d62c1389090031702a78eb884f85378cf3f1

(if you are wonder why the patch doesn't do the the same thing for classdefs that it does for funcdefs, it's because Reinteract doesn't actually rewrite classdefs at all currently - if you have

class A:
    1

That doesn't result in 1 being printed out on evaluation. I think that was intentional on my part - by the time you are defining classes, you are far enough away from "normal" worksheet processing that handling things like standard Python makes more sense.)