On 24/11/2023 21.45, avi.e.gr...@gmail.com wrote:
Grizz[l]y,
I think the point is not about a sorted list or sorting in general It is
about reasons why maintaining a data structure such as a list in a program
can be useful beyond printing things once. There are many possible examples
such as hav
Stefan Ram wrote:
> Chris Green writes:
> >I have to say this seems very non-pythonesque to me, the 'obvious'
> >default simply doesn't work right, and I really can't think of a case
> >where the missing comma would make any sense at all.
>
> |6.15 Expression lists
> ...
> |an expression list co
Hi all,
I apologize in advance for the "foggy"
question, but I've myself unclear ideas.
Anyway...
Python has "context manager".
For example, the "open()" class can be
simply used as follow:
with open(...) as fp:
fp.do_something()
On the other hand, it is also possible to do:
fp = open()
fp
On Sun, 26 Nov 2023 at 21:08, Michael F. Stemper via Python-list
wrote:
>
> On 24/11/2023 21.45, avi.e.gr...@gmail.com wrote:
> > Grizz[l]y,
> >
> > I think the point is not about a sorted list or sorting in general It is
> > about reasons why maintaining a data structure such as a list in a progr
Michael F. Stemper via Python-list schreef op 25/11/2023 om 15:32:
On 24/11/2023 21.45,avi.e.gr...@gmail.com wrote:
> Grizz[l]y,
>
> I think the point is not about a sorted list or sorting in general It is
> about reasons why maintaining a data structure such as a list in a program
> can be us
Piergiorgio Sartor wrote at 2023-11-25 22:15 +0100:
> ...
>Apparently, the "with" context manager is not usable
>in classes, at least not with __init__() & co.
You can use `with` in classes -- with any context manager.
However, you would usually not use `with` with a file you have opened
in `__ini
That is an entirely different discussion, Michael.
I do not know what ideas Guido had ages ago and where he might stand now and
I actually seriously disagree with the snippet you quoted below.
Python was started long ago as a way to improve in some ways on what was
there before. Some of the ide
Just FYI, I deliberately chose that abbreviation for a sort of irony as for
some people college is about almost anything except learning and some people
think they are studs and just party and ...
And I am very tired of gender discussions. Lots of words now include two or
even more genders. Women
On 2023-11-25 08:32:24 -0600, Michael F. Stemper via Python-list wrote:
> On 24/11/2023 21.45, avi.e.gr...@gmail.com wrote:
> > Of course, for serious work, some might suggest avoiding constructs like a
> > list of lists and switch to using modules and data structures [...]
>
> Those who would rec
On 11/27/2023 12:48 AM, Chris Angelico via Python-list wrote:
On Sun, 26 Nov 2023 at 21:08, Michael F. Stemper via Python-list
wrote:
On 24/11/2023 21.45, avi.e.gr...@gmail.com wrote:
Grizz[l]y,
I think the point is not about a sorted list or sorting in general It is
about reasons why mainta
On Mon, 27 Nov 2023 at 06:15, wrote:
> But I learn from criticism. If I ever write a program like that and do not
> feel like typing, will this do?
>
> dents = [ ...]
>
> Or will that not include students who happen to be edentulous?
>
If they're learning to drive, this variable name would make c
On 11/27/2023 1:08 AM, Roel Schroeven via Python-list wrote:
I prefer namedtuples or dataclasses over tuples. They allow you to refer
to their fields by name instead of index: student.gpa is much clearer
than student[2], and makes it less likely to accidentally refer to the
wrong field.
+1
re
On 11/27/2023 10:04 AM, Peter J. Holzer via Python-list wrote:
On 2023-11-25 08:32:24 -0600, Michael F. Stemper via Python-list wrote:
On 24/11/2023 21.45, avi.e.gr...@gmail.com wrote:
Of course, for serious work, some might suggest avoiding constructs like a
list of lists and switch to using m
Isn't it fascinating that a meaningless piece of code used to illustrate
something can be analyzed as if it was full of malicious content?
Yes, my choice of names was as expected. The numbers chosen had no special
meaning other than choosing one number in each of three equivalence classes.
But, i
On Mon, 27 Nov 2023 at 13:52, AVI GROSS via Python-list
wrote:
> Be that as it
> may, and I have no interest in this topic, in the future I may use the ever
> popular names of Primus, Secundus and Tertius and get blamed for using
> Latin.
>
Imperious Prima flashes forth her edict to "begin it".
Dave,
Back on a hopefully more serious note, I want to make a bit of an analogy
with what happens when you save data in a format like a .CSV file.
Often you have a choice of including a header line giving names to the
resulting columns, or not.
If you read in the data to some structure, often to
On 2023-11-26, Dieter Maurer via Python-list wrote:
> If you do not have this case (e.g. usually if you open the file
> in a class's `__init__`), you do not use a context manager.
He knows that. The OP wrote that he wants to use that can
_only_ be used by a context manager, but he wants that us
On 2023-11-27, Grant Edwards via Python-list wrote:
> On 2023-11-26, Dieter Maurer via Python-list wrote:
>
>> If you do not have this case (e.g. usually if you open the file
>> in a class's `__init__`), you do not use a context manager.
>
> He knows that. The OP wrote that he wants to use that
On 27/11/23 9:03 am, Stefan Ram wrote:
Above, "have" is followed by another verb in "have been",
so it should be eligible for a contraction there!
Yes, "been" is the past participle of 'to be", so "I've been" is
fine.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 27/11/23 5:03 pm, Grant Edwards wrote:
I should probably have written "how to fool that into
working when he's not using a 'with' statement"
It should be possible to run the context protocol yourself.
Something like (warning, untested):
class MyDeviceWrapper:
def __init__(self
Avi,
On 11/27/2023 4:15 PM, avi.e.gr...@gmail.com wrote:
Dave,
Back on a hopefully more serious note, I want to make a bit of an analogy
with what happens when you save data in a format like a .CSV file.
Often you have a choice of including a header line giving names to the
resulting columns,
21 matches
Mail list logo