Use of a variable in parent loop
Mike Dewhirst
miked at dewhirst.com.au
Mon Sep 28 01:22:36 EDT 2020
On 28/09/2020 12:56 pm, Stephane Tougard via Python-list wrote:
> On 2020-09-27, Cameron Simpson <cs at cskk.id.au> wrote:
>>> In many non declarative language, if I do print($var), it just prints
>>> and undefined value with returning an error.
>> And that way lie MANY MANY bugs not detected until an undefined value
>> actually causes an issue, if that ever happens. In some languages
> Totally agree, it's not an acceptable behavior.
>
> I would not do some Perl without 'use strict'
I came to Python from Pascal, Perl and PHP. For a while my code was full
of constructs which came from those languages. As time passed and I
lurked on mailing lists I began to see the power of Python. It is
incredibly flexible. You can write code the way you used to or you can
gradually try to write more "Pythonically". The real beauty of Python in
my opinion is genuine OO. And the community.
Perl can be extremely terse, much more so than Python but that is where
the "write-only" criticism comes from. Perl's terseness can only work
for throwaway code.[1] Python is - or can be - quite terse but if
written Pythonically is almost self-documenting. You, or anyone else can
read it in coming years.
Cheers
Mike
[1] If you live with Perl non-stop I agree Perl code can be read in
future. But it requires allocation of serious brain-space for me at
least to come back to it.
--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20200928/b1d5e610/attachment.sig>
More information about the Python-list
mailing list