Passing a callable object to Thread

Paul Rubin http
Sat Feb 16 00:16:10 EST 2008


Jeff Schwab <jeff at schwabcenter.com> writes:
> Why not?  They seem intuitive to me.  I would find it weird if you
> couldn't have 0-tuple, and even weirder if you couldn't have a
> 1-tuple.   Maybe my brain has been warped by too much C++ code.

The idea is that a 2-tuple (of numbers, say) is a pair of numbers, a
3-tuple is three numbers, and a 1-tuple is one number.  That would
mean a number and a 1-tuple of numbers are the same thing, not
separate types.  This is how most type systems treat tuples.

Python does it a bit differently, treating tuples as something like
frozen lists, so they support subscripting, iterator interfaces and so
forth.  There are practical advantages to doing it that way, but it
also leads to corners of oddness like the (a,) notation.



More information about the Python-list mailing list