På Sat, 17 Feb 2018 15:05:34 +1100
Ben Finney <[email protected]> skrev:
> boB Stepp <[email protected]> writes:
> He blithely conflates “weakly typed” (Python objects are not weakly, but
> very strongly typed)
Python is more strongly typed than PHP, but that doesn't really say much.
However, compared to a language like C, there are big holes in the type
safety.
>>> alist = [1, 'two', ('three', four), 5*'#']
That list is not only weakly typed, but rather untyped. There are no
safeguards in the language, that enforce that all elements in a list or
other container are in fact of the same type. Before type annotations and
mypy, I could not enforce that other than at runtime.
So claiming Python to have very strongly typed objects is a bit of a
strecth. PHP that many of us like to be smug about is equally strongly
typed. It just comes with a metric ton of inane type coersions that have
gone too far. However, we are happy to add an integer to a float without
having to make an explicit conversion every time, so ... Thread carefull and
all that.
--
//Wegge
--
https://mail.python.org/mailman/listinfo/python-list