Just for kicks, I counted the number of .py and .pyx files in the Sage 
library, and then counted the ones with lines longer than 80 characters in 
their docstrings/doctests. 84% of them had such lines.


On Saturday, May 30, 2020 at 9:14:59 AM UTC-7, John H Palmieri wrote:
>
> Lines should be shorter than 80 characters when possible. If it isn't 
> possible because it will cause confusion, break a doctest, make a doctest 
> unhelpful, etc., then you can make an exception. There are plenty of 
> exceptions in the Sage library already, for example
>
>
> https://git.sagemath.org/sage.git/tree/src/sage/homology/chain_complex.py#n225
>
> (I just picked a file at random in the Sage library and found an example. 
> I would guess that this is typical.)
>
> Ellipses in doctest output should be used for parts of the output that are 
> random or are too long (as in many lines long) to be useful. The details of 
> the traceback from an error is a typical use case for this.
>
>
> On Saturday, May 30, 2020 at 6:31:34 AM UTC-7, Reimundo Heluani wrote:
>>
>> On May 30, Michael Orlitzky wrote: 
>> >On 5/30/20 8:51 AM, 'Reimundo Heluani' via sage-devel wrote: 
>> >> 
>> >> I've looked through the code and found numerous instances of long 
>> times in 
>> >> examples and tests blocks. So my question is: is there a policy about 
>> these 
>> >> things? My guess is to leave the long lines of output without 
>> wrapping. 
>> >> 
>> > 
>> >You can usually add parentheses and continue your doctest with a "....:" 
>> >on the next line so that the test retains its meaning and the HTML 
>> >output remains correct. For example, here's a line that's too long: 
>> > 
>> >> sage: from mjo.eja.eja_algebra import 
>> QuaternionMatrixEuclideanJordanAlgebra 
>> > 
>> >Instead of forcing a line break with (say) a backslash, you can do 
>> > 
>> >  sage: from mjo.eja.eja_algebra import ( 
>> >  ....:     QuaternionMatrixEuclideanJordanAlgebra ) 
>> > 
>> >The same trick allows you to break sums, products, list comprehensions, 
>> >etc. over multiple lines. 
>> > 
>> Thanks, my question is mainly about output strings, how do you break them 
>> with 
>> ellipsis? 
>>
>> R. 
>>
>> > 
>> >-- 
>> >You received this message because you are subscribed to the Google 
>> Groups "sage-devel" group. 
>> >To unsubscribe from this group and stop receiving emails from it, send 
>> an email to sage-...@googlegroups.com. 
>> >To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-devel/9cbbc443-97e8-deec-d29d-cab5976f3cfd%40orlitzky.com.
>>  
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/9cd7f65c-c9bc-41de-a93b-cbd45639dcf1%40googlegroups.com.

Reply via email to