Perl is worse!

Grant Edwards nobody at nowhere.nohow
Fri Jul 28 21:59:22 EDT 2000


In article <8lsr93$hrq$3 at newshost.accu.uu.nl>, Martijn Faassen wrote:
>Grant Edwards <nobody at nowhere.nohow> wrote:

>> No, 1 is not a sequence.  1 is an integer.  [1] is a sequence.  (1) is a
>> sequence.
>
>In fact the (1) bit _is_ an actual quirk/wart of Python, as (1) is also 1.
>Single element tuples are a bit tricky. (1,) is clearer.

Damn. I keep doing that.  Scheme habits.  I meant that 1, is a sequence not
that (1) is a sequence.  The whole overloaded comma problem requiring parens
to disambiguate things perpetuates the impression that parens are used to
build tuples as [] and {} are used to build lists and dictionaries.

If there were one thing I would change in Python syntax it would be to make
tuple syntax analogous that of dictionaries and lists: with a start delimiter,
elements separated by commas, and an end delimiter.  Picking the delimiter to
use wold be problematic and I guess would have to be multi-char sequence,
which would be ugly.

-- 
Grant Edwards                   grante             Yow!  Now, let's SEND OUT
                                  at               for QUICHE!!
                               visi.com            



More information about the Python-list mailing list