[Chicago] FW: Playing with generics

Peter Fein pfein at pobox.com
Sat Nov 19 03:10:26 CET 2005


Ian Bicking wrote:

> def calc((xa, ya), scale):
>      return atan(xa/ya)*scale
> 
> Though it's a little weird looking, and doesn't lead to the best error 
> messages when you get the signature wrong.

Python's compound-tuple function arguments have to be one of the
stranger programming language features I've ever come across.  Unpacking
compound tuples in a single line[1], ok, but for function arguments,
it's just bizzare. Is this a leagacy from the days before classes?

--Pete

[1] I mean something like (a, b), c = ((1, 2), 3).  This is sometimes
useful.
-- 
Peter Fein                 pfein at pobox.com                 773-575-0694

Basically, if you're not a utopianist, you're a schmuck. -J. Feldman


More information about the Chicago mailing list