Steven D'Aprano writes:
> constructed from
Thank you!
This is what I will use. "Construction" in programming has the strong
connotation of returning a new object (even though, say, int("1")
may return an interned object, so not new in a sense).
I'm not sure whether I'll rely on that loose
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.
I think maybe some of the trouble here, particularly in teaching is the
word "is" (in English, not the Python keyword).
As in:
"A file object IS and iterator"
and
"A zip object IS an iterator"
I know in OO parlance, "is a" can be used to designate subclassing (or an
appropriate use for it) and i
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 why
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
https://ma
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 d
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 05:58:16AM -0400, Ricky Teachey wrote:
> Perhaps use the iter function name as the generic? "itered". As opposed to
> "iterated" or "iterated over".
>
> Example:
>
> "the statement below iterates over an iterator, itered from a sequence"
Or just avoid the issue:
"The st
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 5:37 AM Chris Angelico wrote:
> On Fri, May 15, 2020 at 7:23 PM Stephen J. Turnbull
> wrote:
> >
> > Chris Angelico writes:
> >
> > > I don't like this term "converted".
> >
> > I refuse to die on that hill. :-) Suggest a better term, I'll happily
> > use it until somet
On Fri, May 15, 2020 at 7:23 PM Stephen J. Turnbull
wrote:
>
> Chris Angelico writes:
>
> > > (Technical note: for the convenience of implementors of 'for',
> > > when iter is applied to an iterator, it always returns the
> > > iterator itself.)
> >
> > That's not a mere technical
Chris Angelico writes:
> > (Technical note: for the convenience of implementors of 'for',
> > when iter is applied to an iterator, it always returns the
> > iterator itself.)
>
> That's not a mere technical detail - that's actually part of the
> definition of an iterator, namely
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 o
14 matches
Mail list logo