Favorite non-python language trick?

John Machin sjmachin at lexicon.net
Sat Jun 25 01:54:43 CEST 2005


James Stroud wrote:
> On Friday 24 June 2005 05:58 am, Steven D'Aprano wrote:
> 
>>with colour do begin
>>red := 0; blue := 255; green := 0;
>>end;
>>
>>instead of:
>>
>>colour.red := 0; colour.blue := 255; colour.green := 0;
>>
>>Okay, so maybe it is more of a feature than a trick, but I miss it and it
>>would be nice to have in Python.
> 
> 
> class color:        # americanized
>   red = 0
>   blue = 255
>   green = 0
colour = color
centre = center
# etc etc
> 
> Less typing than pascal. Also avoids those stupid little colons.
> 



More information about the Python-list mailing list