Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

Steven D'Aprano steve at
Fri Feb 19 06:46:31 CET 2010

On Thu, 18 Feb 2010 19:57:35 -0800, Steve Howell wrote:

> The names you give to the intermediate results here are terse--"tuples"
> and "filtered"--so your code reads nicely.
> In a more real world example, the intermediate results would be
> something like this:
>    departments
>    departments_in_new_york
>    departments_in_new_york_not_on_bonus_cycle
>    employees_in_departments_in_new_york_not_on_bonus_cycle
>    names_of_employee_in_departments_in_new_york_not_on_bonus_cycle

Those last two could be written more concisely as:


But seriously... if you have a variable called "departments_in_new_york", 
presumably you also have variables called "departments_in_washington", 
"departments_in_los_angeles", "departments_in_houston", 
"departments_in_walla_walla", and so forth. If so, this is a good sign 
that you are doing it wrong and you need to rethink your algorithm.


More information about the Python-list mailing list