dictionary/hash and '1' versus 1

Paddy paddy3118 at googlemail.com
Mon Jan 7 02:33:06 EST 2008


On Jan 5, 11:07 pm, bearophileH... at lycos.com wrote:
> Paddy:
>
> > Not really, it seems to me to be going the exact opposite way with
> > languages with automatic type conversions being seen as not suited for
> > larger programs.
>
> In Java you can add the number 1 to a string, and have it
> automatically converted to string before the string join... What do
> you think of that feature?
>
> Bye,
> bearophile

Hi Bearophile,
Unfortunately, (fortunately?), I don't know enough Java. I can just
get by reading correct Java programs so could not really comment. If
Java is flexible enough to allow the '+' operator to be defined
between strings and integers and left it to the programmer to define
the result then that would be a good thing, but having the language
automatically define conversions between unrelated types would break
strong typing which I have read that Java enjoys.
  http://en.wikipedia.org/wiki/Type_system#Strong_and_weak_typing

- Paddy.



More information about the Python-list mailing list