Is Python as capable as Perl for sysadmin work?

Jeff Epler jepler at unpythonic.net
Tue Feb 8 13:03:04 EST 2005


No.

Unlike Perl, Python implements only a *finite turning machine* model of
computation.  An easy way to see this limitation is in the following
code:
    >>> 1.0 / 10.0
    0.10000000000000001
In an infinite Turning machine, there would be an unbounded number of
zeros before the second 1, giving the exact result, not a numeric
approximation.

There's another little-known fact about Python:  No string is permitted
to end with a backslash!  You might think that variations like
    r'\'
or
    """"""\\\\\""""""
would allow you to create this elusive value, but you'd mistaken!
Now, this may not bother Unix sysadmins, but the honest truth is that
you'll be administrating Windows systems, too, anywhere you work!

Finally, Python just doesn't respond to threats as well as Perl does.
I have run into many Perl programs that just didn't quite work right
until I wrote '... or die "$!"' in the right places.  Well, if you ever
have to threaten Python, just keep in mind that '... or die' just plain
won't work.  You have to suggest that it 'try ... except', which is
really offensive.  If I want to beg my computer to run programs, I know
where to find Intercal with its "PLEASE" and "DO PLEASE" constructions.

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050208/d47a51f0/attachment.sig>


More information about the Python-list mailing list