[IPython-dev] SVN testers?

Fernando Perez Fernando.Perez at colorado.edu
Fri Jan 20 16:47:18 EST 2006


Arnd Baecker wrote:
> I just updated from svn - Pasting the following:
> 
> class Rectangle:
>     def __init__(self, l1=1.0, l2=2.0):
>         self.l1 = l1
>         self.l2 = l2
> 
>     def get_area(self):
>         return self.l1 * self.l2
> 
>     area = property(get_area)

Mmh.  This stuff is maddening.  I've been thinking about just sitting down and 
_proving_ that it can't be done.  Meaning: that there are inescapably 
ambiguous situations which can't be decided without holding context, while 
keeping autoindent capabilities.  Without autoindent, you can do this, 
provided that you don't leave _empty_ lines:


class Rectangle:
     def __init__(self, l1=1.0, l2=2.0):
         self.l1 = l1
         self.l2 = l2

     def get_area(self):
         return self.l1 * self.l2

     area = property(get_area)

(this one has whitespace in the intermediate lines).  Then  it works:

In [19]: %autoindent
Automatic indentation is: OFF

In [20]: class Rectangle:
    ....:     def __init__(self, l1=1.0, l2=2.0):
    ....:         self.l1 = l1
    ....:         self.l2 = l2
    ....:
    ....:     def get_area(self):
    ....:         return self.l1 * self.l2
    ....:
    ....:     area = property(get_area)
    ....:

In [21]:


Oh well, I'll try it again tomorrow, we'll see where I get.

Cheers,

f




More information about the IPython-dev mailing list