Perl is worse! (was: Python is Wierd!)

Grant Edwards ge at nowhere.none
Fri Jul 28 09:55:43 EDT 2000


In article <slrn8o2fgr.1e2.grey at teleute.rpglink.com>, Steve Lamb wrote:

> As a human, type 1.  Character?  String?  Integer?  Floating
> number?  No, it is 1 and it can be all of those all on context.

To me, the integer 1, the floating point value 1.0, the string
"1", and the ASCII character '1' are all quite distinct things.
I prefer using a notation that unabiguously identifies which
object I mean.

Python has blurred the last two, but I know why it was done and
I can adjust my thinking.  I would prefer that the others
remain distinct.  That is a matter of personal taste.  I know
whether I want an integer or a string or a float and I don't
want the language converting types on me my behind my back.

I'm not entirely thrilled about the way C automagically
converts numerical types -- fortunately lint is available to
plug that hole in the boat.

Perhaps there are people who want the language to attempt to
convert types from what was passed to what was expected, but I
don't.

>>No; "a" is a string and strings are sequences; 1 is an integer, and
>>integers are not sequences.  This particular quirk is in your head.
>
> No, the particular quirk is in the language by forcing types.
> Remember, all this came about because I pointed out that Python
> has just as much automagical "typing" going on as Perl does, it
> just limits that typing from what I can see.

I'm still not sure what is meant by the phrase "forcing types"
but that probably means I should just read the whole thread
again.

-- 
Grant Edwards                   grante             Yow!  My pants just went to
                                  at               high school in the Carlsbad
                               visi.com            Caverns!!!



More information about the Python-list mailing list