On Wed, 7 Jun 2023 at 00:42, Roel Schroeven wrote:
> (Recently there has been an effort to provide clearer and more useful
> error messages; this seems to be a case where there is still room for
> improvement: "SyntaxError: invalid syntax" doesn't immediately remind me
> of that fact that 'return'
On Thu, 8 Jun 2023 at 08:19, Jason Friedman via Python-list
wrote:
>
> This gives the expected results:
>
> with open(data_file, newline="") as reader:
> csvreader = csv.DictReader(reader)
> for row in csvreader:
> #print(row)
> match row[RULE_TYPE]:
> case "RANGE":
> print("range")
> case "MANDAT
On Tue, 13 Jun 2023 at 08:29, Dom Grigonis wrote:
> > I don't know if there's a full explanation written down, but one
> > important reason is that you can refactor async functions without
> > worrying about suddenly changing their behaviour unintentionally. If
> > you happen to refactor out the l
On Tue, 20 Jun 2023 at 02:37, Peter Bona via Python-list
wrote:
>
> Hi
>
> I am wondering if there has been any discussion why NoneType is not iterable
> My feeling is that it should be.
> Sometimes I am using API calls which return None.
> If there is a return value (which is iterable) I am usi
On Wed, 21 Jun 2023 at 03:46, Igor Berger via Python-list
wrote:
> Most of the regulars in this list/group read the posts using the mailing list
> and
> have declared that they explicitly filter out anything posted on Google
> Groups.
>
> I've seen it multiple times with your posts. You respond
On Wed, 21 Jun 2023 at 09:59, Cameron Simpson via Python-list
wrote:
> I wasted some time the other evening on an API which returned a string
> or None. My own API, and the pain it caused tells me that that API
> design choice isn't good (it's an automatic attribute based on a tag,
> returning No
On Thu, 22 Jun 2023 at 02:54, Dan Kolis via Python-list
wrote:
>
> Why do we tolerate this spam ?
>
> this seems most likely a way to inject viruses into people's workflow.
>
> That wiped out usenet. Ahh without an explaination; ( and it woudl have to be
> a good one ); what is the purpsoe of thi
On Sat, 24 Jun 2023 at 15:57, Thomas Passin via Python-list
wrote:
> As a general comment (and I have not done anything tricky or complex
> with Tk), MVC or the other approaches in a similar vein, though good,
> can lead you into more complexity than you need, because of the extra
> abstractions i
On Tue, 4 Jul 2023 at 03:39, Peter Slížik via Python-list
wrote:
>
> Hello.
>
> The legacy code I'm working with uses a classic diamond inheritance. Let me
> call the classes *Top*, *Left*, *Right*, and *Bottom*.
> This is a trivial textbook example. The classes were written in the
> pre-super() e
On Tue, 4 Jul 2023 at 22:06, Peter Slížik via Python-list
wrote:
>
> >
> > Also, you might find that because of the MRO, super() in your Bottom
> > class would actually give you what you want.
> >
>
> I knew this, but I wanted to save myself some refactoring, as the legacy
> code used different si
On Wed, 5 Jul 2023 at 08:35, Alan Gauld via Python-list
wrote:
>
> On 03/07/2023 19:39, Chris Angelico via Python-list wrote:
> > On Tue, 4 Jul 2023 at 03:39, Peter Slížik via Python-list
> >> The legacy code I'm working with uses a classic diamond inheritance.
>
On Wed, 5 Jul 2023 at 10:31, Greg Ewing via Python-list
wrote:
>
> On 5/07/23 10:33 am, Alan Gauld wrote:
> > (*) C++ is the odd one out because it doesn't have GC, but then
> > neither does it have an Object superclass so very often MI in C++
> > does not involve creating diamonds! And especially
On Fri, 7 Jul 2023 at 03:33, neopolitan via Python-list
wrote:
>
> On 6/21/23 08:37, Dan Kolis wrote:
> > Why do we tolerate this spam ?
> >
> > this seems most likely a way to inject viruses into people's workflow.
> >
> > That wiped out usenet. Ahh without an explaination; ( and it woudl have to
On Wed, 26 Jul 2023 at 12:23, Dom Grigonis via Python-list
wrote:
> print(a + 1)# TypeError: unsupported operand type(s) for +: 'A'
> and 'int'
>
> Is there a way to achieve it without actually implementing operators?
> I have looked at Proxy objects, but they do not seem suited to ac
On Wed, 26 Jul 2023 at 16:52, Dom Grigonis wrote:
>
> Could you give an example? Something isn’t working for me.
>
This is a metaclass:
class Meta(type):
...
class Demo(metaclass=Meta):
...
In order to catch those kinds of attribute lookups, you'll need the
metaclass to hook them. And y
On Sat, 5 Aug 2023 at 09:08, dn via Python-list wrote:
>
> On 03/08/2023 11.38, Jon Ribbens via Python-list wrote:
> > On 2023-08-02, dn wrote:
> >> Can you please explain why a multi-part second-argument must be a tuple
> >> and not any other form of collection-type?
> >
> > The following commen
On Sat, 5 Aug 2023 at 09:36, dn via Python-list wrote:
> Faced with a situation where an argument may be a scalar-value or an
> iterable, I'll presume the latter, eg throw it straight into a for-loop.
> If that fails (because the argument is a scalar), use try-except to
> re-route the logic.
That
On Fri, 1 Sept 2023 at 06:39, Chris Green via Python-list
wrote:
>
> What sort of exception should a class raise in __init__() when it
> can't find an appropriate set of data for the parameter passed in to
> the class instantiation?
>
> E.g. I have a database with some names and address in and hav
On Mon, 4 Sept 2023 at 07:44, Pierre Fortin via Python-list
wrote:
>
> Hi,
>
> reversed() results are fine until iterated over, after which the
> results are no longer available. This was discovered after using
> something like this:
>
> rev = reversed( sorted( list ) )
> sr = sum( 1 for _ in rev
On Mon, 18 Sept 2023 at 13:45, Rimu Atkinson via Python-list
wrote:
>
> Hi all,
>
> I'm writing a fediverse server app, similar to kbin https://kbin.pub/en
> and lemmy https://join-lemmy.org/. It's like reddit except anyone can
> run a server in the same way email works.
And the part you didn't s
On Mon, 18 Sept 2023 at 13:49, anthony.flury via Python-list
wrote:
>
>
>
> To me __init__ is a method, but that is implemented internally as
> function associated to a class
>
What is a method, if it is not a function associated with a class?
ChrisA
--
https://mail.python.org/mailman/listinfo/
On Tue, 26 Sept 2023 at 01:39, Jonathan Gossage via Python-list
wrote:
>
> Many thanks, all. It turned out that my problem was not fully understanding
> the use and power of the unpack operator *. Using it to activate my
> generator made things start to work. I changed the line where I invoked the
On Tue, 26 Sept 2023 at 02:52, Piergiorgio Sartor via Python-list
wrote:
>
> On 23/09/2023 09.41, Stefan Ram wrote:
> > r...@zedat.fu-berlin.de (Stefan Ram) writes:
> >> []=[]
> >
> >I was watching a video of a David Beazley talk "Python
> >Concurrency From the Ground Up" , where he wrote
On Thu, 28 Sept 2023 at 01:16, Zuri Shaddai Kuchipudi via Python-list
wrote:
>
> hello everyone this the error that im getting while trying to install and
> upgrade pip on what is the solution for it?
>
The solution is to upgrade to Python 3.
https://pip.pypa.io/en/latest/development/release-pr
On Thu, 28 Sept 2023 at 07:27, Mats Wichmann via Python-list
wrote:
>
> Upgrading to Python 3 is the best answer... except when it isn't. If
> you want to convert a small project it's usually not too hard; and using
> a conversion tool can work well.
Just remember that Python 2.7.18, the very la
On Sun, 1 Oct 2023 at 22:58, Karsten Hilbert via Python-list
wrote:
>
> Sorry for having conflated the core of the matter with all
> the Borg shenanigans, that's where I found the problem in my
> real code, so there :-)
>
> Consider this:
>
> #
>
On Mon, 2 Oct 2023 at 09:10, Barry via Python-list
wrote:
>
>
>
> > On 1 Oct 2023, at 19:36, Richard Damon via Python-list
> > wrote:
> >
> > Perhaps a better method would be rather than just using the name and
> > catching the exception, use a real already_initialized flag (set to True
> > wh
On Wed, 4 Oct 2023 at 15:27, dn via Python-list wrote:
> - should the class have been called either;
>
> class SomethingSingleton():
>
> or a Singleton() class defined, which is then sub-classed, ie
>
> class Something( Singleton ):
>
> in order to better communicate the coder's intent t
On Wed, 4 Oct 2023 at 17:47, Greg Ewing via Python-list
wrote:
>
> On 4/10/23 5:25 pm, dn wrote:
> > The first question when dealing with the Singleton Pattern is what to do
> > when more than one instantiation is attempted
>
> My preferred way of handling singletons is not to expose the class
> i
On Fri, 13 Oct 2023 at 01:48, Chris Green via Python-list
wrote:
>
> In the following code is the event polled by the Python process
> running the code or is there something cleverer going on such that
> Python sees an interrupt when the input goes high (or low)?
>
This isn't something inherent t
On Tue, 17 Oct 2023 at 12:55, Bongo Ferno via Python-list
wrote:
>
> Where I can ask python developers for a new feature?
>
> This feature would allow us to create short aliases for long object paths,
> similar to the with statement. This would make code more readable and
> maintainable.
>
> For
On Thu, 19 Oct 2023 at 10:07, Janis Papanagnou via Python-list
wrote:
>
> I am pondering about writing a client/server software with
> websockets as communication protocol. The clients will run
> in browser as Javascript programs and the server may be in
> any (any sensible) programming language r
On Thu, 19 Oct 2023 at 10:11, Matthew Carruth via Python-list
wrote:
>
> We have the `Optional[T]` type as a short-hand for Union[T | None] and
> telling us that said argument may not be present.
>
> However, I find that a majority of the time, we also want to set a default
> value of None on th
On Thu, 19 Oct 2023 at 18:04, Karsten Hilbert wrote:
>
> > > or something like that. Basically, any way to avoid writing `= None` over
> > > and over again.
> >
> > Fundamentally no, at least not without some shenanigans. Type hints do
> > not affect the regular running of the code,
>
> Except wh
On Thu, 19 Oct 2023 at 18:25, Karsten Hilbert wrote:
>
> > > > Fundamentally no, at least not without some shenanigans. Type hints do
> > > > not affect the regular running of the code,
> > >
> > > Except when they do ;-)
> > >
> > > ... depending on what counts as (valid) code ...
> > >
> > > In
On Thu, 19 Oct 2023 at 19:34, Karsten Hilbert wrote:
>
> > > As per my recent foray into abusing existence-checking for Singleton
> > > assurance
> > > along such lines as
> > >
> > > >>> try: self.initialized
> > > >>> except AttributeError: print('first instantiation'); self.initialized
> > >
On Fri, 20 Oct 2023 at 22:31, Janis Papanagnou via Python-list
wrote:
>
> On 19.10.2023 01:23, Chris Angelico wrote:
> >
> > Broadly speaking, your ideas are great. Any programming language CAN
> > be used for the server (and I've used several, not just Python).
>
> Out of curiosity; what where th
On Sun, 22 Oct 2023 at 04:13, Janis Papanagnou via Python-list
wrote:
> I have a couple decades experience with about a dozen programming
> languages (not counting assemblers). Asynchronous processing, IPC,
> multi-processing, client/server architectures, multi-threading,
> semaphores, etc. etc. a
On Wed, 25 Oct 2023 at 12:11, Thomas Passin via Python-list
wrote:
> This doesn't mean that no program can ever be proven to halt, nor that
> no program can never be proven correct by formal means. Will your
> program be one of those? The answer may never come ...
Indeed, and I would go further
On Wed, 25 Oct 2023 at 12:20, AVI GROSS via Python-list
wrote:
> Consider an example of bit rot. I mean what if your CPU or hard disk has a
> location where you can write a byte and read it back multiple times and
> sometimes get the wrong result. To be really cautions, you might need your
> so
On Wed, 25 Oct 2023 at 13:02, Mike H via Python-list
wrote:
> Is it possible to use lambda expression instead of defining a `Key` class?
> Something like `sorted(my_list, key = lambda x, y: x+y > y+x)`?
Look up functools.cmp_to_key.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-lis
On Wed, 25 Oct 2023 at 19:00, Frank Millman via Python-list
wrote:
> 2. Instead of running as a stand-alone server, run my app as a
> reverse-proxy using Nginx. I tested this a few years ago using Apache,
> and it 'just worked', so I am fairly sure that it will work with Nginx
> as well. Nginx can
On Wed, 25 Oct 2023 at 21:46, o1bigtenor wrote:
> > 2. Catch the failure as you save. We have a lot of tools that can help
> > you to spot bugs.
>
> Tools like this for python please.
Various ones. Type checkers like MyPy fall into this category if you
set your system up to run them when you save
On Wed, 25 Oct 2023 at 21:53, o1bigtenor wrote:
>
> Hmm - - - - now how can I combine 'Hamming codes'
> and a raid array?
>
> TIA
Normally you wouldn't. But let's say you're worried that a file might
get randomly damaged. (I don't think single-bit errors are really a
significant issue wit
On Wed, 25 Oct 2023 at 22:46, o1bigtenor via Python-list
wrote:
>
> On Wed, Oct 25, 2023 at 6:24 AM Dieter Maurer wrote:
> >
> > o1bigtenor wrote at 2023-10-24 07:22 -0500:
> > > ...
> > >Is there a way to verify that a program is going to do what it is
> > >supposed to do even
> > >before all th
On Thu, 2 Nov 2023 at 05:21, Simon Connah via Python-list
wrote:
>
> Could someone push me in the right direction please? I just want to find out
> if a string is a valid email address.
There is only one way to know that a string is a valid email address,
and that's to send an email to it.
What
On Thu, 2 Nov 2023 at 06:02, Jon Ribbens via Python-list
wrote:
>
> On 2023-11-01, Chris Angelico wrote:
> > On Thu, 2 Nov 2023 at 05:21, Simon Connah via Python-list
> > wrote:
> >> Could someone push me in the right direction please? I just want to
> >> find out if a string is a valid email add
On Thu, 2 Nov 2023 at 08:09, Grant Edwards via Python-list
wrote:
> Make sure it has an '@' in it. Possibly require at least one '.'
> after the '@'.
No guarantee that there'll be a dot after the at. (Technically there's
no guarantee of an at sign either, but email addresses without at
signs are
On Thu, 2 Nov 2023 at 08:52, Grant Edwards via Python-list
wrote:
>
> On 2023-11-01, Chris Angelico via Python-list wrote:
> > On Thu, 2 Nov 2023 at 08:09, Grant Edwards via Python-list
> > wrote:
>
> >> Make sure it has an '@' in it. Possibly
On Thu, 2 Nov 2023 at 15:20, AVI GROSS via Python-list
wrote:
>
> Yes, it would be nice if there was a syntax for sending a test message sort
> of like an ACK that is not delivered to the recipient but merely results in
> some status being sent back such as DELIVERABLE or NO SUCH USER or even
> MA
On Thu, 2 Nov 2023 at 17:47, Simon Connah wrote:
>
> My goal is to make a simple mailing list platform. I guess I could just send
> email to an address and if it bounces then I can remove it from the database.
> Thing is I'm not sure how close to a real email address an email has to be in
> ord
On Thu, 2 Nov 2023 at 17:47, Cameron Simpson via Python-list
wrote:
>
> On 02Nov2023 17:04, Chris Angelico wrote:
> >On Thu, 2 Nov 2023 at 15:20, AVI GROSS via Python-list
> > wrote:
> >> Yes, it would be nice if there was a syntax for sending a test
> >> message sort
> >> of like an ACK that is
On Fri, 3 Nov 2023 at 07:17, Jon Ribbens via Python-list
wrote:
>
> On 2023-11-02, Simon Connah wrote:
> > Valid as in conforms to the standard. Although having looked at the
> > standard that might be more difficult than originally planned.
>
> Yes. Almost nobody actually implements "the standar
On Fri, 3 Nov 2023 at 12:21, AVI GROSS via Python-list
wrote:
> My guess is that a first test of an email address might be to see if a decent
> module of that kind fills out the object to your satisfaction. You can then
> perhaps test parts of the object, rather than everything at once, to see i
On Tue, 7 Nov 2023 at 02:05, Jon Ribbens via Python-list
wrote:
> That was another thing that I used to find ridiculous, but seems to have
> improved somewhat in recent years - website error pages that said "please
> contact us to let us know about this error". I'm sorry, what? You want
> me to co
On Tue, 7 Nov 2023 at 07:10, Mats Wichmann via Python-list
wrote:
> Suggests maybe labeling should be something like:
>
> * Number you want to be called on
> * Number for texted security messages, if different
>
> Never seen that, though :-)
>
My responses would be:
* Don't.
* That's what crypto
On Tue, 7 Nov 2023 at 10:11, Greg Ewing via Python-list
wrote:
>
> On 7/11/23 7:45 am, Mats Wichmann wrote:
> > Continuing with the example, if you have a single phone number field, or
> > let a mobile number be entered in a field marked for landline, you will
> > probably assume you can text to t
On Sun, 12 Nov 2023 at 21:27, Y Y via Python-list
wrote:
>
> I am curious and humble to ask: What is the purpose of a BEEP?
>
There are several purposes. I can't say which of these are relevant to
the OP, but some or all of them could easily be.
* A very very simple notification that can be trig
On Mon, 13 Nov 2023 at 04:13, MRAB via Python-list
wrote:
> In the old days, with a BBC micro, that was simple. It had 3 tone
> channels and 1 white noise channel, with control over frequency,
> duration and volume, beeps on different channels could be synchronised
> to start at the same time, the
On Tue, 14 Nov 2023 at 08:57, Axel Reichert via Python-list
wrote:
>
> Barry writes:
>
> > I do not understand how xor(iterator) works.
> > I thought xor takes exactly 2 args.
>
> See
>
> https://mathworld.wolfram.com/XOR.html
>
> for some background (I was not aware of any generalizations for
On Tue, 14 Nov 2023 at 10:00, Dom Grigonis via Python-list
wrote:
>
> I am not asking. Just inquiring if the function that I described could be
> useful for more people.
>
> Which is: a function with API that of `all` and `any` and returns `True` if
> specified number of elements is True.
>
> It
On Tue, 14 Nov 2023 at 11:29, Dom Grigonis via Python-list
wrote:
>
>
> > Except the 'any' and 'all' builtins are _exactly_ the same as bitwise
> > or and and applided to many bits. To do something "in line" with that
> > using the 'xor' operator would return True for an odd number of True
> > val
On Tue, 14 Nov 2023 at 12:02, Dom Grigonis via Python-list
wrote:
> As I am here, I will dare to ask if there is no way that `sign` function is
> going to be added to `math` or `builtins`.
>
https://docs.python.org/3/library/math.html#math.copysign
ChrisA
--
https://mail.python.org/mailman/lis
On Tue, 14 Nov 2023 at 11:40, Chris Angelico wrote:
> Here's a couple of excellent videos on error correction, and you'll
> see XOR showing up as a crucial feature:
>
> https://www.youtube.com/watch?v=X8jsijhllIA
> https://www.youtube.com/watch?v=h0jloehRKas
>
I just flipped through that 3blue1br
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
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 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".
On Mon, 27 Nov 2023 at 22:31, Dom Grigonis via Python-list
wrote:
>
> Hi all,
>
> I have a situation, maybe someone can give some insight.
>
> Say I want to have input which is comma separated array (e.g.
> paths='path1,path2,path3') and convert it to the desired output - list:
This is a single
On Mon, 25 Dec 2023 at 15:42, Mike Dewhirst via Python-list
wrote:
>
> Apologies for top posting - my phone seems unable to do otherwise.
>
> Here's my view - which may not be popular.
You're right about that part, anyhow :)
> 4. Shebang lines are pretty much redundant now that most python inter
On Tue, 26 Dec 2023 at 07:27, Chris Grace via Python-list
wrote:
> I'd also recommend a newer version of python. Python 3.4 reached end of
> life almost 5 years ago.
Uhh, putting this in perspective... until a spammer revived the thread
just now, it was asked, answered, and finished with, all bac
On Fri, 29 Dec 2023 at 12:23, Félix An via Python-list
wrote:
>
> On 2023-12-25 12:36, Mike Dewhirst wrote:
> >
> > 3. You cannot trust Microsoft. You can trust Python Software Foundation.
> > Python from PSF works the same in all environments - or if not it is a bug.
> > Python from Microsoft i
On Sat, 30 Dec 2023 at 01:16, Left Right via Python-list
wrote:
>
> That's not the discussion that was toxic. But the one that was --
> doesn't exist anymore since the forum owners deleted it.
>
> The part where the forum owners delete whatever they disagree with is
> the toxic part.
Yeah, becaus
On Sat, 30 Dec 2023 at 01:37, Left Right wrote:
>
> > Yeah, because you have the God-given RIGHT to be able to say anything
> > you like, on anyone's web site, and nobody's allowed to delete
> > anything you say! That's how it goes, right?
>
> I don't believe in god, and I don't believe he / she c
On Sat, 30 Dec 2023 at 06:58, Left Right wrote:
> My understanding is that "welcome and encourage participation by
> everyone" is in stark contradiction to banning someone disagreeing
> with you.
Then your understanding is flat-out wrong. Encouraging participation
by everyone DOES mean deleting w
On Sat, 30 Dec 2023 at 14:06, Mike Dewhirst via Python-list
wrote:
>
> On 29/12/2023 12:09 pm, Félix An via Python-list wrote:
> > On 2023-12-25 12:36, Mike Dewhirst wrote:
> >>
> >> 3. You cannot trust Microsoft. You can trust Python Software
> >> Foundation. Python from PSF works the same in all
On Sun, 31 Dec 2023 at 03:38, Thomas Passin via Python-list
wrote:
> I am not very expert in Python type hints. In working up the example
> program I just posted, I got an error message from mypy that remarked
> that "list" is invariant, and to try Sequence which is "covariant". I
> don't know w
On Fri, 12 Jan 2024 at 08:56, Left Right via Python-list
wrote:
>
> By the way, in an attempt to golf this problem, I discovered this,
> which seems like a parser problem:
When you jump immediately to "this is a bug", all you do is make
yourself look like an idiot. Unsurprisingly, this is NOT a b
On Sat, 13 Jan 2024 at 13:11, Left Right via Python-list
wrote:
>
> Very few
> languages allow arbitrary complex expressions in the same place they
> allow variable introduction.
What do you mean by this? Most languages I've worked with allow
variables to be initialized with arbitrary expression
On Sun, 14 Jan 2024 at 14:43, dn via Python-list wrote:
> Similarly, whilst we could write:
>
> a, b, c = 1, 2, 3
>
I would only do this when it aligns particularly well with the
algorithm being implemented. For example, you could start a Fibonacci
evaluator with "a, b = 0, 1". Otherwise, there's
On Sun, 14 Jan 2024 at 23:28, Left Right wrote:
> Having worked with a bunch of different grammar languages, the one
> used for Python isn't a recognizable BNF derivative.
That might possibly be because it isn't? It's not BNF. It's PEG. Or
are you a long way behind the times?
> For example, you
On Mon, 15 Jan 2024 at 00:27, Left Right wrote:
>
> > What do you mean?
> >
> > for x in lambda: ...:
> > ...
> >
> > Perfectly grammatical.
>
> 1. You put the lambda definition in the wrong place (it should be in
> the left-hand side, or as Python calls it "star_targets", but you put
> it into
On Mon, 15 Jan 2024 at 08:15, Left Right wrote:
> Python grammar rules prevent function definition from
> appearing in left-hand side of the head of the for loop. However, a
> variable declaration, which is also a statement, is allowed there.
What is a "variable declaration" in Python? Please el
On Mon, 15 Jan 2024 at 09:40, dn via Python-list wrote:
> The basic challenge came from my earlier (and blasé) repetition of the
> Python refrain "everything in Python is an object". Which led to:
>
> <<<
> For example, you may say "functions in Python are
> objects", but you cannot put a function
On Mon, 15 Jan 2024 at 12:12, dn via Python-list wrote:
> Here's another witticism I'll often toss at trainees (in many languages,
> and especially in UX): just because we can do it, doesn't make it a good
> idea!
>
Programming. We were so busy with whether we COULD that we didn't stop
to think i
On Mon, 15 Jan 2024 at 12:42, dn via Python-list wrote:
>
> On 15/01/24 14:33, Chris Angelico via Python-list wrote:
> > On Mon, 15 Jan 2024 at 12:12, dn via Python-list
> > wrote:
> >> Here's another witticism I'll often toss at trainees (in many langua
On Mon, 15 Jan 2024 at 18:56, Greg Ewing via Python-list
wrote:
>
> On 15/01/24 1:28 am, Left Right wrote:
> > Python isn't a context-free language, so the grammar that is used to
> > describe it doesn't actually describe the language
>
> Very few languages have a formal grammar that *fully* descr
On Mon, 15 Jan 2024 at 19:26, Greg Ewing via Python-list
wrote:
>
> On 15/01/24 9:07 pm, Chris Angelico wrote:
> > The grammar *can't* specify everything. If it did, it would have to
> > have rules for combining individual letters into a NAME and individual
> > characters into a string literal.
>
On Tue, 16 Jan 2024 at 06:32, Akkana Peck via Python-list
wrote:
>
> > Frank Millman wrote at 2024-1-15 15:51 +0200:
> > >I have read that one should not have to worry about garbage collection
> > >in modern versions of Python - it 'just works'.
>
> Dieter Maurer via Python-list writes:
> > There
On Tue, 16 Jan 2024 at 13:49, Akkana Peck via Python-list
wrote:
>
> I wrote:
> > > Also be warned that some modules (particularly if they're based on
> > > libraries not written in Python) might not garbage collect, so you may
> > > need to use other methods of cleaning up after those objects.
On Tue, 16 Jan 2024 at 23:08, Frank Millman via Python-list
wrote:
>
> On 2024-01-15 3:51 PM, Frank Millman via Python-list wrote:
> > Hi all
> >
> > I have read that one should not have to worry about garbage collection
> > in modern versions of Python - it 'just works'.
> >
> > I don't want to r
On Wed, 17 Jan 2024 at 01:45, Frank Millman via Python-list
wrote:
>
> On 2024-01-16 2:15 PM, Chris Angelico via Python-list wrote:
> >
> > Where do you tend to "leave a reference dangling somewhere"? How is
> > this occurring? Is it a result of an incomplete tra
On Sat, 27 Jan 2024 at 11:01, Greg Ewing via Python-list
wrote:
>
> If it helps at all, you can think of an async function as being
> very similar to a generator, and "await" as being very similar to
> "yield from". In the current implementation they're almost exactly
> the same thing underneath.
On Fri, 9 Feb 2024 at 17:03, Cameron Simpson via Python-list
wrote:
>
> On 08Feb2024 12:21, tony.fl...@btinternet.com
> wrote:
> >I know that mappings by default support the ** operator, to unpack the
> >mapping into key word arguments.
> >
> >Has it been considered implementing a dunder method
On Mon, 19 Feb 2024 at 06:47, Grant Edwards via Python-list
wrote:
> I would be tempted to try monkey-patching the float class to override
> the __format__ method. I have no idea what side effects that might
> have, or if it's even used by the various formatting mechanisms, so
> you might end up s
On Sat, 9 Mar 2024 at 00:51, Grant Edwards via Python-list
wrote:
> One might argue that "global" isn't a good choice for what to call the
> scope in question, since it's not global. It's limited to that source
> file. It doesn't make sense to me to call a binding "global", when
> there can be mul
On Sat, 9 Mar 2024 at 03:42, Grant Edwards via Python-list
wrote:
>
> On 2024-03-08, Chris Angelico via Python-list wrote:
> > On Sat, 9 Mar 2024 at 00:51, Grant Edwards via Python-list
> > wrote:
> >
> >> One might argue that "global" isn't
On Tue, 12 Mar 2024 at 07:54, Ivan "Rambius" Ivanov via Python-list
wrote:
> I am refactoring some code and I would like to get rid of a global
> variable. Here is the outline:
>
> ...
>
> I have never done that in Python because I deliberately avoided such
> complicated situations up to now. I kn
On Tue, 12 Mar 2024 at 08:04, Ivan "Rambius" Ivanov
wrote:
> > A Singleton is just a global variable. Why do this? Did someone tell
> > you "global variables are bad, don't use them"?
>
> I have bad experience with global variables because it is hard to
> track what and when modifies them. I don't
On Wed, 20 Mar 2024 at 18:31, Greg Ewing via Python-list
wrote:
>
> On 20/03/24 4:14 pm, Lawrence D'Oliveiro wrote:
> > not to
> > mention the latency when there isn’t quite enough memory for an allocation
> > and you have to wait until the next GC run to proceed. Run the GC a
> > thousand times a
On Fri, 22 Mar 2024 at 18:35, Lars Liedtke via Python-list
wrote:
>
> Hey,
>
> As far as I know (might be old news) flask does not support asyncio.
>
> You would have to use a different framework, like e.g. FastAPI or similar.
> Maybe someone has already written "flask with asyncio" but I don't k
1 - 100 of 139 matches
Mail list logo