Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Line continuations in doctests, changing files in sage/tests
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David Roe  
View profile  
 More options Oct 24 2012, 3:24 am
From: David Roe <roed.m...@gmail.com>
Date: Wed, 24 Oct 2012 01:23:47 -0600
Local: Wed, Oct 24 2012 3:23 am
Subject: Line continuations in doctests, changing files in sage/tests

Hi everyone,
I'm working on #12415 and am revising the methods for continuing lines.
Currently you can continue a line with the standard python ..., which looks
good in standard Python doctests since it has the same length as >>>, but
doesn't look at nice in Sage.  After #12415 the doctesting code will
replace "....: " with "..." before passing it on to Python's doctest module.

Sage currently treats a backslash at the end of the line as a continuation
character which is nonstandard but allows us to write large integers that
span multiple lines.  For example:

sage: n = 7403756347956171282804679609742957314259318888\
....: 9231289084936232638972765034028266276891996419625117\
....: 8439958943305021275853701189680982867331732731089309\
....: 0055250511687706329907239638078671008609696253793465\
....: 0563796359

1.  Are there any objections to continuing to allow this backslash notation?
2.  Are there any opinions on whether we should change the format some
files in sage/tests to use "....: " rather than "..." for line
continuations?  The "..." continuations will continue to work so doctests
pass even without this change, but it would make the formatting of the
tests more readable.  On the other hand I know that many of the tests come
from published books and there's value in staying exactly the same as the
book.

The new doctesting code at #12415 is almost done.  Over the past week I
fixed a bunch of issues and there's only one remaining that I'm aware of: a
segfault that occurs if test/interrupt.pyx is tested, but only if it's not
the first file being tested.  Help debugging from someone who's more versed
in Sage's signal handling would be welcome.
David
http://trac.sagemath.org/sage_trac/ticket/12415


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon King  
View profile  
 More options Oct 24 2012, 5:46 am
From: Simon King <simon.k...@uni-jena.de>
Date: Wed, 24 Oct 2012 09:45:58 +0000 (UTC)
Local: Wed, Oct 24 2012 5:45 am
Subject: Re: Line continuations in doctests, changing files in sage/tests
Hi David,

On 2012-10-24, David Roe <roed.m...@gmail.com> wrote:

> 1.  Are there any objections to continuing to allow this backslash notation?

At least not from me.

> 2.  Are there any opinions on whether we should change the format some
> files in sage/tests to use "....: " rather than "..." for line
> continuations?

Since "....: " is shown in interactive sessions if you define something
that spans over several lines, I'd actually appreciate to use "....: "
rather than "...". In that way, one could simply copy-and-paste when
creating a doc test.

However, it would also be nice if doc tests could simply be pasted into
an interactive session.

best regards,
Simon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Roe  
View profile  
 More options Oct 24 2012, 6:30 am
From: David Roe <roed.m...@gmail.com>
Date: Wed, 24 Oct 2012 04:29:55 -0600
Local: Wed, Oct 24 2012 6:29 am
Subject: Re: [sage-devel] Re: Line continuations in doctests, changing files in sage/tests

I agree that this would be nice.  I recall a discussion from Sage Days 40.5
where Volker was working on upgrading IPython and there was a choice to be
made between being able to paste in doctests and something else, but I
don't recall the details.
David

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Grout  
View profile  
 More options Oct 24 2012, 10:04 am
From: Jason Grout <jason-s...@creativetrax.com>
Date: Wed, 24 Oct 2012 09:04:12 -0500
Local: Wed, Oct 24 2012 10:04 am
Subject: Re: Line continuations in doctests, changing files in sage/tests
On 10/24/12 5:29 AM, David Roe wrote:

It was probably the tradeoff between automatic indentation and pasting
in lines.  If you have auto indent, then pasting in lines that end in a
: mess up the indentation.  IPython says that you should use %cpaste to
go into a "paste" mode, which turns off autoindentation, among other things.

By the way, I think we're about finishing up the IPython upgrade at
#12719.  People are welcome to review it and test it out!  I'm
particularly curious how it and this ticket interact, since both are
changing the doctest framework a bit.

Thanks,

Jason


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Keshav Kini  
View profile  
 More options Nov 18 2012, 9:48 pm
From: Keshav Kini <keshav.k...@gmail.com>
Date: Sun, 18 Nov 2012 18:48:17 -0800
Local: Sun, Nov 18 2012 9:48 pm
Subject: Re: Line continuations in doctests, changing files in sage/tests

No objection.

> 2.  Are there any opinions on whether we should change the format
> some files in sage/tests to use "....: " rather than "..." for line
> continuations?  The "..." continuations will continue to work so
> doctests pass even without this change, but it would make the
> formatting of the tests more readable.  On the other hand I know that
> many of the tests come from published books and there's value in
> staying exactly the same as the book.

Yes, please change this! The first trac ticket I opened, #10458, was
about changing this :)

> The new doctesting code at #12415 is almost done.  Over the past week
> I fixed a bunch of issues and there's only one remaining that I'm
> aware of: a segfault that occurs if test/interrupt.pyx is tested, but
> only if it's not the first file being tested.  Help debugging from
> someone who's more versed in Sage's signal handling would be welcome.
> David
> http://trac.sagemath.org/sage_trac/ticket/12415

Bravo! Here's hoping it gets in soon.

-Keshav


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »