3 ms·
Python does weak typing and doesn't have 1% of the unexpected nonsense PHP has.
by VHRanger 4y ago
Python does weak typing and doesn't have 1% of the unexpected nonsense PHP has.
- mkl 4y agoYou're probably thinking of dynamic typing, which Python has, but Python's typing is strong, not weak, so e.g. '1' == 1 returns False.
- zarzavat 4y agoPython has strong typing, but it does use duck typing. Weak typing is when a language inserts implicit coercions in unexpected places, such as 42 == “42”. It’s not a precisely defined term. Another example is in C where pointers and values may be mixed and matched, although less so nowadays.
- giantrobot 4y agoPython has dynamic but strong typing. There's no hidden type coercion. A dev might run into behavior they don't expect but the behavior is documented and regular.
- vhcr 4y agoPython is strongly typed though.