Favorite non-python language trick?

Steven D'Aprano steve at REMOVETHIScyber.com.au
Fri Jun 24 08:58:56 EDT 2005


On Fri, 24 Jun 2005 00:55:38 -0600, Joseph Garvin wrote:

> I'm curious -- what is everyone's favorite trick from a non-python 
> language? And -- why isn't it in Python?

Long ago, I used to dabble in Forth. You could say, the entire Forth
language was a trick :-) It was interesting to be able to define your own
compiler commands, loop constructs and so forth.

One of the things I liked in Pascal was the "with" keyword. You could
write something like this:

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.


-- 
Steven




More information about the Python-list mailing list