On Nov 27, 12:03 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > Iain King <[EMAIL PROTECTED]> wrote: > > FTR, I won't be using this :) I do like this syntax though: > > > class Vector: > > def __init__(self, x, y, z): > > self.x = x > > self.y = y > > self.z = z > > def abs(self): > > using self: > > return math.sqrt(.x*.x + .y*.y + .z*.z) > > It is a bit verbose though. This variant is shorter on my system[*]: > > class Vector: > def __init__(self, x, y, z): > self.x = x > self.y = y > self.z = z > def abs(self): > return math.sqrt(self.x*self.x + self.y*self.y + self.z*self.z) > > [*] Windows, they are the same length on Linux. > > :)
Yeah, in this example. Another would be using NetworkConnection: .address = "127.0.0.1" .port = "8080" .connect() using .connection while .read(): do something .disconnect() I doubt anything like this will take though, since you can write similar code with 'with' and assigning a long name to a short one. Iain -- http://mail.python.org/mailman/listinfo/python-list