How do you propose separating input and output?
I think it should be pretty easy to write a function that converts the
former form to the latter form. Maybe you can make it a trac ticket?
Jason
What about the situation the poster describes, where you want to strip
the example down to something you can stick into the file? A function
would be nice to do that:
strip_example("""
sage: s=0
sage: for i in range(100):
....: s=s+i
....:
sage: print s
4950
""")
prints
s=0
for i in range(100):
s=s+i
print s
and then it's easy to copy and paste the example into a file.
-Jason
Some comments about this thread:
(1) We're not changing the docstring format for two reasons:
(a) There are now over 40,000 lines of just *input* docstrings in the
main sage library!
teragon:plot was$ sage -grep "sage:" |wc -l
40353
(b) The current format is imposed by Python; it's already the
standard Python docstring
format, and hence we should stick with it.
(2) It is annoying that ipython formats input with a stupid ....:
instead of the ... format like
in Python. Fernando -- why does Ipython do that?
teragon:plot was$ sage -python
Python 2.5.1 (r251:54863, Jan 18 2008, 16:10:52)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> for n in range(10):
... print n
...
0
1...
(3) In the Sage notebook, if you make a worksheet, then click "Text"
in the top right area,
you'll get plain text formated for inclusion in docstrings.
--- William