> def class Colour: > def __init__(self, blue=0, green=0, red=0): > # pseudo-Python code borrowing concept "with" from Pascal > with self: > blue = blue > green = green > red = red > > And now you can see why Python doesn't support this idiom.
Maybe it would make more sense if it was done a la Visual Basic with self: .blue = blue .green = green .red = red requiring a dot to be typed removes the ambiguity and gives the IDEs a chance to Intellisense-ify your coding. -- http://mail.python.org/mailman/listinfo/python-list