Andrew Barnert writes:
> >> The answer is that files are iterators, while lists are… well,
> >> there is no word.
> >
> > As Chris B said, sure there are words: File objects are *already*
> > iterators, while lists are *not*. My question is, "why isn't that
> > instructive?"
>
> Well,
On May 14, 2020, at 20:17, Stephen J. Turnbull
wrote:
>
> Andrew Barnert writes:
>
>> Students often want to know why this doesn’t work:
>> with open("file") as f:
>> for line in file:
>> do_stuff(line)
>> for line in file:
>> do_other_stuff(line)
>
> Sure.
Oops, try again;
Here's an article about recent research. I found it fascinating.
https://www.quantamagazine.org/ideal-glass-would-explain-why-glass-exists-at-all-20200311/
It starts: Glass is anything that’s rigid like a crystal, yet made of
disordered molecules like a liquid. To understand
Here's an article about recent research:
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
On 16/05/20 12:26 am, Steven D'Aprano wrote:
Arguments over the precise definition of states of matter are, to some
degree, futile. I've seen amorphous solids described as "liquids that
don't flow" and non-Newtonian liquids described as "solids that flow".
I think this just shows that nature
On Thu, May 14, 2020, 11:20 PM Stephen J. Turnbull
> > I can teach a child why a glass will break permanently when you hit
> > it while a lake won’t by using the words “solid” and “liquid”.
>
> Terrible example, since a glass is just a geologically slow liquid. ;-)
>
It isn't though. I used to
On Fri, May 15, 2020 at 12:17:56PM +0900, Stephen J. Turnbull wrote:
> Terrible example, since a glass is just a geologically slow liquid. ;-)
That's a myth :-)
The key test for a liquid is not whether is flows, since solids also
flow. (In solids, this usually happens very, very slowly, and is
On Fri, May 15, 2020 at 1:19 PM Stephen J. Turnbull
wrote:
> ISTM that all we need to say is that
>
> 1. An *iterator* is a Python object whose only necessary function is
> to return an object when next is applied to it. Its purpose is to
> keep track of "next" for *for*. (It might do