sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.34k stars 452 forks source link

Add an appropriate line break after showing the source code of an object #11857

Open burcin opened 13 years ago

burcin commented 13 years ago

The following only displays documentation for power series ring.

sage: PS = ZZ[['x']]
sage: PS??
Type:           PowerSeriesRing_domain
Base Class:     <class 'sage.rings.power_series_ring.PowerSeriesRing_domain'>
String Form:    Power Series Ring in x over Integer Ring
Namespace:      Interactive
File:           /mnt/local/king/SAGE/broken/local/lib/python2.6/site-packages/sage/rings/power_series_ring.py
Definition:     PS(self, f, prec=+Infinity, check=True)
Source:
class PowerSeriesRing_domain(PowerSeriesRing_generic, integral_domain.IntegralDomain):
      passConstructor Docstring:
       Initializes a power series ring.

       INPUT:
...

Hence, the source code

class PowerSeriesRing_domain(PowerSeriesRing_generic, integral_domain.IntegralDomain):
      pass

is shown, but it is not followed by a line break. That's ugly and difficult to read

CC: @simon-king-jena

Component: user interface

Keywords: line break, source introspection

Issue created by migration from https://trac.sagemath.org/ticket/11857

simon-king-jena commented 13 years ago
comment:1

Burcin, are you sure that the source is not shown? The source actually is

class PowerSeriesRing_domain(PowerSeriesRing_generic, integral_domain.IntegralDomain):
      pass

The only problem is that there may be no line break after the "pass", the doc string is appended immediately.

simon-king-jena commented 12 years ago
comment:2

On the one hand, one may think that this ticket is invalid (because the source code is printed). However, there is no line break after the source code, which means that it is difficult to read. I suggest to keep the ticket and change the purpose into "add an appropriate line break".

simon-king-jena commented 12 years ago
comment:3

Since nobody objected, I am changing the topic of this ticket.

simon-king-jena commented 12 years ago

Changed keywords from none to line break, source introspection

simon-king-jena commented 12 years ago

Description changed:

--- 
+++ 
@@ -3,4 +3,25 @@

sage: PS = ZZ[['x']] sage: PS?? +Type: PowerSeriesRing_domain +Base Class: <class 'sage.rings.power_series_ring.PowerSeriesRing_domain'> +String Form: Power Series Ring in x over Integer Ring +Namespace: Interactive +File: /mnt/local/king/SAGE/broken/local/lib/python2.6/site-packages/sage/rings/power_series_ring.py +Definition: PS(self, f, prec=+Infinity, check=True) +Source: +class PowerSeriesRing_domain(PowerSeriesRing_generic, integral_domain.IntegralDomain):