[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

syntax difference

  To: Chris Angelico
From: Bart <bc at freeuk.com>

On 24/06/2018 15:46, Chris Angelico wrote:
> On Sun, Jun 24, 2018 at 8:40 PM, Steven D'Aprano
> <steve+comp.lang.python at pearwood.info> wrote:
>> On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote:
>>> I wonder why it is just me that constantly needs to justify his
>>> existence in this group?
>> Because its just you who spends 90% of his time here complaining about
>> how Python does it wrong.
> ... and spends 95% of that time demonstrating his utter lack of
> understanding of how Python does it at all. It's wrong even though you
> don't understand how it actually works.

More like utter disbelief at how it works. Surely it cannot work like that
because it would be too inefficient? Apparently, yes it can...

And all to support extreme dynamism which is only really needed a tiny
proportion of the time (feel free to correct me).

I know I'm going to get flak for bringing this up this old issue, but remember
when you used to write a for-loop and it involved creating an actual list of N
integers from 0 to N-1 in order to iterate through them? Crazy.

But that has long been fixed - or so I thought. When I wrote, today:

    for i in range(100000000): pass      # 100 million

on Python 2, it used up 1.8GB, up to the limit of my RAM, and it took several
minutes to regain control of my machine (and it never did finish). You don't
expect that in 2018 when executing a simple empty loop.

On Py 2 you have to use xrange for large ranges - that was the fix.

Somebody however must have had to gently and tactfully point out the issue. I'm
 afraid I'm not very tactful.


--- BBBS/Li6 v4.10 Toy-3
 * Origin: Prism bbs (1:261/38)