New to Python: my impression v. Perl/Ruby
Ville Vainio
ville.spamstermeister.vainio at thisisspamprotectiontut.finland
Tue Jan 20 15:58:21 EST 2004
>>>>> "Phil" == Phil Tomson <ptkwt at aracnet.com> writes:
Phil> Different strokes for different folks, I guess. I remember
Phil> that one of the first things I saw about Ruby was that even
Phil> interger literals were objects that can receive messages and
Phil> thinking how wonderful that was. As you say, you're not
Ints are objects in python too:
>>> a=1
>>> a.__lshift__(1)
2
Though "sending messages" to int literals is a syntax error.
Phil> 10.times do something end
Phil> is somehow so clear. It's almost zenlike.
It's cute and fun to write, but less cute for people who have to read
lots of such code in short time. I have a soft spot for such style
also; I kinda like Python's "\n".join(["foo","bar"]), even if most
seem to consider it a wart for readability reasons.
--
Ville Vainio http://tinyurl.com/2prnb
More information about the Python-list
mailing list