[OT] Perl woes
Peter Corlett
abuse at cabal.org.uk
Wed Jan 28 14:02:54 GMT 2009
On 28 Jan 2009, at 11:58, Nicholas Clark wrote:
[...]
> Whereas in dynamic languages, a variable doesn't know its type at
> run time, so you need two operators to ensure deterministic
> behaviour and sanity.)
Python is dynamic and manages this just fine:
$ python
Python 2.5.2 (r252:60911, Aug 6 2008, 09:17:29)
[GCC 4.3.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> '1' + '2'
'12'
>>> 1 + 2
3
>>> 1 + '2'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'
(My complaints about Python are in other annoying corners of the
language.)
More information about the london.pm
mailing list