Tuples

Gerrit Holl gerrit.holl at pobox.com
Wed Jan 26 16:16:06 EST 2000


Hello,

With tuples, some things aren't really Pythonic. In some cases, even
the Perl-like TMTOWTDI thing is true!
a = {}
a[1,2] = 'f'

is equivalent to:
a = {}
a=[(1,2)] = 'f'

And:
"aaa %s bbb" % 'foo'

is equivalent to:
"aaa %s bbb" % ('foo',)

Why's that? TMTOWTDI does not improve readability...

regards,
Gerrit.

-- 
Please correct any bad English you encounter in my email message!
-----BEGIN GEEK CODE BLOCK----- http://www.geekcode.com
Version: 3.12
GCS dpu s-:-- a14 C++++>$ UL++ P--- L+++ E--- W++ N o? K? w--- !O !M !V PS+ PE?
Y? PGP-- t- 5? X? R- tv- b+(++) DI D+ G++ !e !r !y
-----END GEEK CODE BLOCK-----




More information about the Python-list mailing list