The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

Chris Angelico rosuav at gmail.com
Mon Mar 21 03:15:50 EDT 2016


On Mon, Mar 21, 2016 at 5:38 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Monday 21 March 2016 12:35, Chris Angelico wrote:
>
>> On Mon, Mar 21, 2016 at 12:28 PM, Mark Lawrence <breamoreboy at yahoo.co.uk>
>> wrote:
>>> I got to line 22, saw the bare except, and promptly gave up.
>>
>> Oh, keep going, Mark. It gets better.
> [...]
>> So, if any exception happens during the reading of the file, it gets
>> squashed, and 0 is returned - which results in a generic message being
>> printed, and the program terminating, with return value 0. Awesome!
>
>
> While there is a certain level of entertainment to be gained from snarking
> at other people's bad code, and I'm as guilty as anyone else for doing so,
> please remember that Bart is engaged in a good-faith attempt to compare
> Python to other dynamic code. He's not claiming to be a Python expert or
> that he's writing idiomatic Python code.

Given that the exact same issue was pointed out the last time he
posted a version of this code, I have less sympathy and more snark. I
completely understand that not everyone understands what's idiomatic
Python code; but when something is pointed out as a deadly
anti-pattern (not just "that naming convention might confuse people"),
I would expect to see changes.

ChrisA



More information about the Python-list mailing list