RE: A technique from a chatbot

2024-04-02 Thread AVI GROSS via Python-list
nt(first_word_beginning_with_e( text )) print(first_word_beginning_with_e( NorEaster )) Result of running it on a version of python ay least 3.8 so it supports the walrus operator: eastern None -Original Message- From: Python-list On Behalf Of Thomas Passin via Python-list Sent: Tue

Re: A technique from a chatbot

2024-04-02 Thread Thomas Passin via Python-list
On 4/2/2024 1:47 PM, Piergiorgio Sartor via Python-list wrote: On 02/04/2024 19.18, Stefan Ram wrote:    Some people can't believe it when I say that chatbots improve    my programming productivity. So, here's a technique I learned    from a chatbot!    It is a structured "break". &qu

Re: A technique from a chatbot

2024-04-02 Thread Piergiorgio Sartor via Python-list
metimes will not be executed here! So, "return" is similar to "break" in that regard. But in Python we can write: def first_word_beginning_with_e( list_ ): return next( ( word for word in list_ if word[ 0 ]== 'e' ), None ) Doesn't look a smart advice. . No

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-04-02 Thread Barry via Python-list
> On 1 Apr 2024, at 18:14, Left Right via Python-list > wrote: > > It sounds weird that symbols from Limited API are _missing_ (I'd > expect them to be there no matter what library version you link with). You have to specify the version of the limited API that you want to us

Re: Trying to use pyinstaller under python 3.11, and, recently started receiving error message about specific module/distribution

2024-04-02 Thread Barry via Python-list
> On 1 Apr 2024, at 15:52, Jacob Kruger via Python-list > wrote: > > Found many, many mentions of errors, with some of the same keywords, but, no > resolutions that match my exact issue at all. Try asking the pyinstaller developers. I think there is a maili

magic-wormhole 0.14.0

2024-04-01 Thread meejah via Python-list
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Greetings, I'm pleased to announce that magic-wormhole 0.14.0 is released. Magic Wormhole is a Python library and CLI tool to securely get arbitrary data from one computer to another using short, one-time, human- pronouncable codes and end-to-end

Re: Multiplication

2024-04-01 Thread dn via Python-list
The April Fools joke was on those of us who never received/have yet to receive @Stefan's OP. On 2/04/24 08:02, Avi Gross via Python-list wrote: Is this a April 1 post for fools. Multiplication with an asterisk symbol is built into python. The same symbol used in other contexts has other

Re: Multiplication

2024-04-01 Thread Avi Gross via Python-list
Is this a April 1 post for fools. Multiplication with an asterisk symbol is built into python. The same symbol used in other contexts has other contexts has an assortment of largely unrelated meanings such as meaning everything when used to import. On Mon, Apr 1, 2024, 1:27 PM Piergiorgio

Re: Multiplication

2024-04-01 Thread D'Arcy Cain via Python-list
On 2024-04-01 12:35, Joel Goldstick via Python-list wrote: On Mon, Apr 1, 2024 at 1:26 PM Piergiorgio Sartor via Python-list ^^^ from math import * a = 2 b = 3 print( a * b ) I guess the operator "*" can be imported from any module... :-) No import is

Re: xkcd.com/353 ( Flying with Python )

2024-04-01 Thread PA via Python-list
> On Mar 30, 2024, at 22:09, Johanne Fairchild via Python-list > wrote: > > Sigil is noun. Definitions: > > A seal; a signet. > A sign or an image considered magical. > A seal; a signature. Creating Sigils The origin and design process informing Urbit's gener

Re: Multiplication

2024-04-01 Thread Joel Goldstick via Python-list
On Mon, Apr 1, 2024 at 1:26 PM Piergiorgio Sartor via Python-list wrote: > > On 01/04/2024 10.40, Stefan Ram wrote: > > Q: How can I multiply two variables in Python? I tried: > > > > a = 2 > > b = 3 > > print( ab ) > > > > but it di

Re: xkcd.com/353 ( Flying with Python )

2024-04-01 Thread inhahe via Python-list
On Mon, Apr 1, 2024 at 1:26 PM HenHanna via Python-list < python-list@python.org> wrote: > Johanne Fairchild wrote: > > > HenHanna writes: > > >> https://xkcd.com/1306/ > >> what does SIGIL mean? > > > A glyph

Re: xkcd.com/353 ( Flying with Python )

2024-04-01 Thread HenHanna via Python-list
Found in a real dictionary : Camel case , int,char, min, len, def, elseif cons, defun, cond, goto, -- https://mail.python.org/mailman/listinfo/python-list

Re: Multiplication

2024-04-01 Thread Piergiorgio Sartor via Python-list
On 01/04/2024 10.40, Stefan Ram wrote: Q: How can I multiply two variables in Python? I tried: a = 2 b = 3 print( ab ) but it did not work. A: No, this cannot work. To multiply, you need the multiplication operator. You can import the multiplication operator from

Re: xkcd.com/353 ( Flying with Python )

2024-04-01 Thread Blue-Maned_Hawk via Python-list
u know what you are?” “Confused?” -- https://mail.python.org/mailman/listinfo/python-list

Re: xkcd.com/353 ( Flying with Python )

2024-04-01 Thread Johanne Fairchild via Python-list
A seal; a signet. A sign or an image considered magical. A seal; a signature. Source: The American Heritage® Dictionary of the English Language, 5th Edition. -- https://mail.python.org/mailman/listinfo/python-list

Re: xkcd.com/353 ( Flying with Python )

2024-04-01 Thread HenHanna via Python-list
/1306:_Sigil_Cycle -- https://mail.python.org/mailman/listinfo/python-list

xkcd.com/353 ( Flying with Python )

2024-04-01 Thread HenHanna via Python-list
https://xkcd.com/353/ ( Flying with Python ) https://xkcd.com/1306/ what does SIGIL mean? Other xkcd that you like? -- https://mail.python.org/mailman/listinfo/python-list

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-04-01 Thread Left Right via Python-list
ver looked at again. You, kind of, are already walking into the world of pain trying to make Python binary packages, and then you also want them to be cross-platform, and then you want them to be usable by different versions of Python... Unless it's for your own amusement, I'd just have a package p

Re: A missing iterator on itertools module?

2024-04-01 Thread Mark Bourne via Python-list
etermine a module's public API. In that case, setting `__all__ = ["f"]` in `A` should prevent it from offering `math` as a completion (nor any other name that's not in the `__all__` list). -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: Trying to use pyinstaller under python 3.11, and, recently started receiving error message about specific module/distribution

2024-04-01 Thread Jacob Kruger via Python-list
Found many, many mentions of errors, with some of the same keywords, but, no resolutions that match my exact issue at all. As in, most of them are mentioning older versions of python, and, mainly different platforms - mac and linux, but, various google searches have not mentioned much

RE: Can you help me with this memoization simple example?

2024-03-31 Thread AVI GROSS via Python-list
I am not sure if it was made clear that there is a general rule in python for what is HASHABLE and lists are changeable while tuples are not so the latter can be hashed as a simple copy of a list, albeit the contents must also be immutable. The memorize function uses a dictionary to store

Re: Can you help me with this memoization simple example?

2024-03-31 Thread MRAB via Python-list
t in cache: cache[key] = f(args[0], args[1]) return cache[key] return g Anything else is good in my code ? Thanks Le dim. 31 mars 2024 à 01:44, MRAB via Python-list a écrit : On 2024-03-31 00:09, marc nicole via Python-list wrote: > I am creating a memoization example wi

Re: xkcd.com/353 ( Flying with Python )

2024-03-31 Thread Peter J. Holzer via Python-list
On 2024-03-31 12:27:34 -0600, Mats Wichmann via Python-list wrote: > On 3/30/24 10:31, MRAB via Python-list wrote: > > On 2024-03-30 11:25, Skip Montanaro via Python-list wrote: > > > > > https://xkcd.com/1306/ > > > > >   what does 

Re: xkcd.com/353 ( Flying with Python )

2024-03-31 Thread Peter J. Holzer via Python-list
On 2024-03-30 17:58:08 +, Alan Gauld via Python-list wrote: > On 30/03/2024 07:04, Greg Ewing via Python-list wrote: > > On 30/03/24 7:21 pm, HenHanna wrote: > >> https://xkcd.com/1306/ > >> what does  SIGIL   mean? > > > &

Re: xkcd.com/353 ( Flying with Python )

2024-03-31 Thread Mats Wichmann via Python-list
On 3/30/24 10:31, MRAB via Python-list wrote: On 2024-03-30 11:25, Skip Montanaro via Python-list wrote: > https://xkcd.com/1306/ >   what does  SIGIL   mean? I think its' a Perl term, referring to the $/@/# symbols in front of identifiers. I wouldn't co

Re: Trying to use pyinstaller under python 3.11, and, recently started receiving error message about specific module/distribution

2024-03-31 Thread Barry via Python-list
> On 31 Mar 2024, at 13:24, Jacob Kruger via Python-list > wrote: > > pkg_resources.DistributionNotFound: The 'altgraph' distribution was not found > and is required by the application I think I have seen this error being discussed before… A web search for pyinstaller and t

Trying to use pyinstaller under python 3.11, and, recently started receiving error message about specific module/distribution

2024-03-31 Thread Jacob Kruger via Python-list
the application # ---end of output--- I have tried completely removing python's installation, and, reinstalling it, but, same issue more or less immediately. If I freeze pip's installed list within this specific virtual environment, it lists the following: altgraph==0.17.4 packaging==24.0

Re: Can you help me with this memoization simple example?

2024-03-31 Thread marc nicole via Python-list
ch tuple I should use to refer to the underlying list value as you suggest? Anything else is good in my code ? Thanks Le dim. 31 mars 2024 à 01:44, MRAB via Python-list a écrit : > On 2024-03-31 00:09, marc nicole via Python-list wrote: > > I am creating a memoization example with a fu

Re: Can you help me with this memoization simple example?

2024-03-30 Thread MRAB via Python-list
On 2024-03-31 00:09, marc nicole via Python-list wrote: I am creating a memoization example with a function that adds up / averages the elements of an array and compares it with the cached ones to retrieve them in case they are already stored. In addition, I want to store only if the result

Can you help me with this memoization simple example?

2024-03-30 Thread marc nicole via Python-list
vg") elapsed = time.time() - t print(res) print(elapsed) -- https://mail.python.org/mailman/listinfo/python-list

Re: xkcd.com/353 ( Flying with Python )

2024-03-30 Thread Alan Gauld via Python-list
On 30/03/2024 07:04, Greg Ewing via Python-list wrote: > On 30/03/24 7:21 pm, HenHanna wrote: >> https://xkcd.com/1306/ >> what does  SIGIL   mean? > > I think its' a Perl term, referring to the $/@/# symbols in front of > identifiers.

Re: xkcd.com/353 ( Flying with Python )

2024-03-30 Thread MRAB via Python-list
On 2024-03-30 11:25, Skip Montanaro via Python-list wrote: > https://xkcd.com/1306/ > what does SIGIL mean? I think its' a Perl term, referring to the $/@/# symbols in front of identifiers. I had a vague recollection of hearing it elsewhere (*Game of T

Re: xkcd.com/353 ( Flying with Python )

2024-03-30 Thread Skip Montanaro via Python-list
ags?), but didn't know what it meant. Google tells me: *an inscribed or painted symbol considered to have magical power.* So, they're more than just line noise. They confer power on their users... Perhaps '@' in the context of decorators is the most prominent example in Python, since decorat

Re: xkcd.com/353 ( Flying with Python )

2024-03-30 Thread Greg Ewing via Python-list
On 30/03/24 7:21 pm, HenHanna wrote: https://xkcd.com/1306/ what does  SIGIL   mean? I think its' a Perl term, referring to the $/@/# symbols in front of identifiers. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-03-29 Thread Barry Scott via Python-list
> On 29 Mar 2024, at 16:09, Olivier B. > wrote: > > It is not a symlink on my system, where i built python myself, but a > 15KB so file. But it seems to lack lots of python symbols. > > Maybe what i should do is actually make libpython.so a physical copy > of libpy

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-03-29 Thread Olivier B. via Python-list
It is not a symlink on my system, where i built python myself, but a 15KB so file. But it seems to lack lots of python symbols. Maybe what i should do is actually make libpython.so a physical copy of libpyton311.so before linking to it, so now on any system the module would look to load

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-03-29 Thread Barry via Python-list
> On 28 Mar 2024, at 16:13, Olivier B. via Python-list > wrote: > > But on Linux, it seems that linking to libpython3.so instead of > libpython3.11.so.1.0 does not have the same effect, and results in > many unresolved python symbols at link time > > Is this func

Re: A missing iterator on itertools module?

2024-03-28 Thread ast via Python-list
n iterable. You could also use "*" instead of "list" to print it. So, import itertools as _itertools s =[ "AZERTY", "QSDFGH", "WXCVBN" ] print( *_itertools.chain.from_iterable( zip( *s ))) . But these are only minor nitpicks; you have found a nice solution! Why did you renamed itertools as _itertools ? -- https://mail.python.org/mailman/listinfo/python-list

Re: A missing iterator on itertools module?

2024-03-28 Thread ast via Python-list
Le 28/03/2024 à 17:45, ast a écrit : A Q W Z S C E D C ... sorry A Q W Z S X E D C -- https://mail.python.org/mailman/listinfo/python-list

A missing iterator on itertools module?

2024-03-28 Thread ast via Python-list
ip("AZERTY", "QSDFGH", "WXCVBN"))) ['A', 'Q', 'W', 'Z', 'S', 'X', 'E', 'D', 'C', 'R', 'F', 'V', 'T', 'G', 'B', 'Y', 'H', 'N'] Do you havbe a neat solution ? -- https://mail.python.org/mailman/listinfo/python-list

Making 'compiled' modules work with multiple python versions on Linux

2024-03-28 Thread Olivier B. via Python-list
I have a python module that includes some C++ code that links with the Python C API I have now modified the c++ code so that it only uses the Limited API, and linked with python3.lib instead of python311.lib. I can now use that python module with different python versions on Windows

RE: Popping key causes dict derived from object to revert to object (3/25/2024)

2024-03-27 Thread Dr. F. M. (Mike) Covington via Python-list
Hello, all. I guess I'm just not seeing this dictionary pop() problem you're having. What version of Python are you using? Is there something I'm missing? If I've made an obvious oversight, please forgive me and explain. Thanks! PyCharm (2023.1.1) REPL running Python 3.12

RE: Popping key causes dict derived from object to revert to object

2024-03-25 Thread AVI GROSS via Python-list
= {key:value for key in dict if key != "whatever"} Or variants on that. It builds a new dictionary, at nontrivial expense, as compared to using del on an existing dictionary. -Original Message----- From: Python-list On Behalf Of Loris Bennett via Python-list Sent: Monday, March 25, 20

RE: Popping key causes dict derived from object to revert to object

2024-03-25 Thread AVI GROSS via Python-list
of something else and initially in Python were not guaranteed to have any kind of order. Python dicts are more like unordered sets. So although there remains a concept of not first/rest but this/rest, I suspect there was some thought about the process that ended in deciding not to supply some

Re: Popping key causes dict derived from object to revert to object

2024-03-25 Thread Grant Edwards via Python-list
On 2024-03-25, Loris Bennett via Python-list wrote: > Grant Edwards writes: > >> On 2024-03-22, Loris Bennett via Python-list wrote: >> >>> Yes, I was mistakenly thinking that the popping the element would >>> leave me with the dict minus the popped key-v

Re: Popping key causes dict derived from object to revert to object

2024-03-25 Thread Loris Bennett via Python-list
"Michael F. Stemper" writes: > On 25/03/2024 01.56, Loris Bennett wrote: >> Grant Edwards writes: >> >>> On 2024-03-22, Loris Bennett via Python-list wrote: >>> >>>> Yes, I was mistakenly thinking that the popping the element would >

Re: Popping key causes dict derived from object to revert to object

2024-03-25 Thread Jon Ribbens via Python-list
On 2024-03-25, Loris Bennett wrote: > "Michael F. Stemper" writes: > >> On 25/03/2024 01.56, Loris Bennett wrote: >>> Grant Edwards writes: >>> >>>> On 2024-03-22, Loris Bennett via Python-list >>>> wrote: >>>

Re: Popping key causes dict derived from object to revert to object

2024-03-25 Thread Michael F. Stemper via Python-list
On 25/03/2024 01.56, Loris Bennett wrote: Grant Edwards writes: On 2024-03-22, Loris Bennett via Python-list wrote: Yes, I was mistakenly thinking that the popping the element would leave me with the dict minus the popped key-value pair. It does. Indeed, but I was thinking

Re: Popping key causes dict derived from object to revert to object

2024-03-25 Thread Loris Bennett via Python-list
Grant Edwards writes: > On 2024-03-22, Loris Bennett via Python-list wrote: > >> Yes, I was mistakenly thinking that the popping the element would >> leave me with the dict minus the popped key-value pair. > > It does. Indeed, but I was thinking in the context o

Re: ANN: EmPy 4.1 -- a powerful, robust and mature templating system for Python

2024-03-25 Thread Barry via Python-list
You should considered also announcing on https://discuss.python.org/ which is a lot more active then this list. Barry > On 25 Mar 2024, at 04:13, Erik Max Francis via Python-list > wrote: > > I'm pleased to announce the release of EmPy 4.1. > > The 4._x_ series

Re: Popping key causes dict derived from object to revert to object

2024-03-25 Thread Loris Bennett via Python-list
have now decided I want something else :-) Nevertheless it is good to know that 'del' exists, so that I don't have to reinvent it. Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

Re: the name ``wheel''

2024-03-24 Thread Barry via Python-list
> On 22 Mar 2024, at 20:28, Mats Wichmann via Python-list > wrote: > > pip is still a separate package in the .rpm world. which makes sense on a > couple of levels: Yes it’s a separate package, but it’s always installed. At least on Fedora. I agree it makes sense to packag

Re: Using a background thread with asyncio/futures with flask

2024-03-24 Thread Frank Millman via Python-list
On 2024-03-23 3:25 PM, Frank Millman via Python-list wrote: It is not pretty! call_soon_threadsafe() is a loop function, but the loop is not accessible from a different thread. Therefore I include a reference to the loop in the message passed to in_queue, which in turn passes

Re: Using a background thread with asyncio/futures with flask

2024-03-23 Thread Frank Millman via Python-list
On 2024-03-22 12:08 PM, Thomas Nyberg via Python-list wrote: Hi, Yeah so flask does support async (when installed with `pip3 install flask[async]), but you are making a good point that flask in this case is a distraction. Here's an example using just the standard library that exhibits

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Mark Bourne via Python-list
re). Anyway at this point I feel like the easiest approach is to just throw away threads entirely and learn how to do all I want fully in the brave new async world, but I'm still curious why this is failing and how to make this sort of setup work since it points to my not understanding the basic i

Re: the name ``wheel''

2024-03-22 Thread Mats Wichmann via Python-list
On 3/22/24 11:45, Barry via Python-list wrote:  On 22 Mar 2024, at 15:25, Gilmeh Serda via Python-list wrote: Many if not most Linux distributions do not include pip by default. Really? It came with Manjaro. Debian and Ubuntu require you to install pip as a separate package. Also puts

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Dieter Maurer via Python-list
lt/exception for a future in a "foreign" thread ("foreign" here means one not associated with the future's loop). An aternative to the solution sketched above is to set the result indirectly via `loop.call_soon_threadsafe`. This way, the result is set in the futures "native" thread. -- https://mail.python.org/mailman/listinfo/python-list

RE: Popping key causes dict derived from object to revert to object

2024-03-22 Thread AVI GROSS via Python-list
Or do you want to be able to call it as in dict.remaining(key) by subclassing your own variant of dict and adding a similar method? -- https://mail.python.org/mailman/listinfo/python-list

Re: the name ``wheel''

2024-03-22 Thread Barry via Python-list
 > On 22 Mar 2024, at 15:25, Gilmeh Serda via Python-list > wrote: > >> Many if not most Linux distributions do not include pip by default. > > Really? It came with Manjaro. Debian and Ubuntu require you to install pip as a separate package. Also puts venv in its own pa

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Dieter Maurer via Python-list
ou likely will use `concurrent.Future` (not `asyncio.Future`). You can use `asyncio.futures._chain_futures` to associate an `asyncio.Future` with a `concurrent.Future`. Then the fate (result or exception set) of one will be reflected in the other. -- https://mail.python.org/mailman/listinfo/python-list

Re: Popping key causes dict derived from object to revert to object

2024-03-22 Thread Grant Edwards via Python-list
On 2024-03-22, Loris Bennett via Python-list wrote: > Yes, I was mistakenly thinking that the popping the element would > leave me with the dict minus the popped key-value pair. It does. > Seem like there is no such function. Yes, there is. You can do that with either pop or del:

Re: the name ``wheel''

2024-03-22 Thread Thomas Schweikle via Python-list
Am Do., 21.März.2024 um 18:58:26 schrieb Johanne Fairchild via Python-list: r...@zedat.fu-berlin.de (Stefan Ram) writes: Johanne Fairchild wrote or quoted: Why is a whl-package called a ``wheel''? Is it just a pronunciation for the extension WHL or is it really a name? PyPi in its

Re: Popping key causes dict derived from object to revert to object

2024-03-22 Thread Loris Bennett via Python-list
_instance_state'] > (There's not really any point popping the value if you're not going to > do anything with it - just delete the key from the dictionary) Yes, I was mistakenly thinking that the popping the element would leave me with the dict minus the popped key-value pair. Seem like there is no such function. Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

Re: Popping key causes dict derived from object to revert to object

2024-03-22 Thread Mark Bourne via Python-list
popping the value if you're not going to do anything with it - just delete the key from the dictionary) -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Frank Millman via Python-list
On 2024-03-22 1:23 PM, Frank Millman via Python-list wrote: On 2024-03-22 12:09 PM, Frank Millman via Python-list wrote: I am no expert. However, I do have something similar in my app, and it works. I do not use 'await future', I use 'asyncio.wait_for(future)'. I tested it and it did

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Frank Millman via Python-list
On 2024-03-22 12:09 PM, Frank Millman via Python-list wrote: I am no expert. However, I do have something similar in my app, and it works. I do not use 'await future', I use 'asyncio.wait_for(future)'. I tested it and it did not work. I am not sure, but I think the problem is that you

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Lars Liedtke via Python-list
policy https://www.solute.de/ger/datenschutz/grundsaetze-der-datenverarbeitung.php Am 22.03.24 um 08:58 schrieb Chris Angelico via Python-list: On Fri, 22 Mar 2024 at 18:35, Lars Liedtke via Python-list <mailto:python-list@python.org> wrote: Hey, As far as I know (might be old news) flask does n

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Frank Millman via Python-list
On 2024-03-20 10:22 AM, Thomas Nyberg via Python-list wrote: Hello, I have a simple (and not working) example of what I'm trying to do. This is a simplified version of what I'm trying to achieve (obviously the background workers and finalizer functions will do more later): `app.py

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Thomas Nyberg via Python-list
iest approach is to just throw away threads entirely and learn how to do all I want fully in the brave new async world, but I'm still curious why this is failing and how to make this sort of setup work since it points to my not understanding the basic implementation/semantics of async in pyt

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Chris Angelico via Python-list
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

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Lars Liedtke via Python-list
Am 20.03.24 um 09:22 schrieb Thomas Nyberg via Python-list: Hello, I have a simple (and not working) example of what I'm trying to do. This is a simplified version of what I'm trying to achieve (obviously the background workers and finalizer functions will do more later): `app.py` ```

Re: the name ``wheel''

2024-03-21 Thread Thomas Passin via Python-list
On 3/21/2024 4:19 PM, Grant Edwards via Python-list wrote: On 2024-03-21, MRAB via Python-list wrote: As it's recommended to use the Python Launcher py on Windows, I use that instead: py -m pip install something because it gives better support if you have multiple versions of Python

Re: the name ``wheel''

2024-03-21 Thread Grant Edwards via Python-list
On 2024-03-21, MRAB via Python-list wrote: > As it's recommended to use the Python Launcher py on Windows, I use > that instead: > > py -m pip install something > > because it gives better support if you have multiple versions of > Python installed. I adopted that practi

Re: the name ``wheel''

2024-03-21 Thread MRAB via Python-list
On 2024-03-21 11:36, Johanne Fairchild via Python-list wrote: Why is a whl-package called a ``wheel''? Is it just a pronunciation for the extension WHL or is it really a name? Also, it seems that when I install Python on Windows, it doesn't come with pip ready to run. I had to say python

Re: the name ``wheel''

2024-03-21 Thread Johanne Fairchild via Python-list
the famous > part in the show "Monty Python Cheese Shop". Because initially it > only hosted links to the packages, so it was empty like that shop. > And within a cheese shop what do you store? Wheels of cheese. Lol! Loved it. (Thanks very much.) >>Also, it seem

Re: the name ``wheel''

2024-03-21 Thread Left Right via Python-list
I believe that the name "Wheel" was a reference to "reinventing the wheel". But I cannot find a quote to support this claim. I think the general sentiment was that it was the second attempt by the Python community to come up with a packaging format (first being Egg), and so t

Re: Popping key causes dict derived from object to revert to object

2024-03-21 Thread Dieter Maurer via Python-list
is what you have popped. > >If I comment out the third line, which pops the unwanted key, I get Then you do not change `event_dicts`. You problem likely is: `pop` does not return the `dict` after the removal of a key but the removed value. -- https://mail.python.org/mailman/listinfo/python-list

the name ``wheel''

2024-03-21 Thread Johanne Fairchild via Python-list
Why is a whl-package called a ``wheel''? Is it just a pronunciation for the extension WHL or is it really a name? Also, it seems that when I install Python on Windows, it doesn't come with pip ready to run. I had to say python -m ensurepip and then I saw that a pip on a whl-package

Popping key causes dict derived from object to revert to object

2024-03-21 Thread Loris Bennett via Python-list
eys cause the elements of the list to revert back to their original class? Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

Using a background thread with asyncio/futures with flask

2024-03-20 Thread Thomas Nyberg via Python-list
zer got future: finalizer set result ``` Judging by what's printing out, the `final result = await future` doesn't seem to be happy here. Maybe someone sees something obvious I'm doing wrong here? I presume I'm mixing threads and asyncio in a way I shouldn't be. Here's some system information

Re: Configuring an object via a dictionary

2024-03-20 Thread Dan Sommers via Python-list
On 2024-03-20 at 09:49:54 +0100, Roel Schroeven via Python-list wrote: > You haven't only checked for None! You have rejected *every* falsish value, > even though they may very well be acceptable values. OTOH, only you can answer these questions about your situations. Every application,

Re: Configuring an object via a dictionary

2024-03-20 Thread Roel Schroeven via Python-list
Op 19/03/2024 om 0:44 schreef Gilmeh Serda via Python-list: On Mon, 18 Mar 2024 10:09:27 +1300, dn wrote: > YMMV! > NB your corporate Style Guide may prefer 'the happy path'... If you only want to check for None, this works too: >>> name = None >>> dafault_va

Re: GIL-Removal Project Takes Another Step (Posting On Python-List Prohibited)

2024-03-20 Thread Chris Angelico via Python-list
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

Re: GIL-Removal Project Takes Another Step (Posting On Python-List Prohibited)

2024-03-20 Thread Greg Ewing via Python-list
works. If you run out of memory, you run a GC there and then. You don't have to wait for GCs to occur on a time schedule. Also, as a previous poster pointed out, GCs are typically scheduled by number of allocations, not by time. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Configuring an object via a dictionary

2024-03-19 Thread Pokemon Chw via Python-list
he same as the fields you want to be assigned to in your class Loris Bennett via Python-list 于2024年3月19日周二 01:39写道: > Tobiah writes: > > > I should mention that I wanted to answer your question, > > but I wouldn't actually do this. I'd rather opt for > > your self.config = config s

[RELEASE] Python 3.10.14, 3.9.19, and 3.8.19 is now available

2024-03-19 Thread Łukasz Langa via Python-list
Howdy! Those are the boring security releases that aren’t supposed to bring anything new. But not this time! We do have a bit of news, actually. But first things first: go update your systems! <https://discuss.python.org/t/python-3-10-14-3-9-19-and-3-8-19-is-now-available/48993#python-3101

Re: Configuring an object via a dictionary

2024-03-18 Thread Loris Bennett via Python-list
ing is not that significant. Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

Re: Configuring an object via a dictionary

2024-03-18 Thread Tobiah via Python-list
by itself so you can do foo.config.option. You'd fill it's attributes in the same way I suggested for your main object. -- https://mail.python.org/mailman/listinfo/python-list

Re: Configuring an object via a dictionary

2024-03-18 Thread Tobiah via Python-list
({'cat': 'dog'}) print(f.cat) (outputs 'dog') -- https://mail.python.org/mailman/listinfo/python-list

Re: Configuring an object via a dictionary

2024-03-18 Thread Anders Munch via Python-list
self.conf = Settings(**config) regards, Anders -- https://mail.python.org/mailman/listinfo/python-list

[Ann] managesieve v0.8 released

2024-03-18 Thread Hartmut Goebel via Python-list
module: Python-Software-Foundation-like License   - for sieveshell and test suite: GNU Public Licence v3 (GPLv3) :Quick Installation:     pip install -U managesieve :Tarballs:  https://pypi.org/project/managesieve/#files What is managesieve? - A ManageSieve client library

RE: Configuring an object via a dictionary

2024-03-17 Thread AVI GROSS via Python-list
If we are bringing up other languages, let's return to what was part of the original question. How van a dictionary be used in python if your goal is to sort of use it to instantiate it into a set of variables and values inside the local or global or other namespaces? Can we learn anything

Re: MTG: Introductions to PyQt and DataClasses

2024-03-17 Thread dn via Python-list
/should I 'do more', and similar. One of the valuable observations is that most of us would benefit by improving our sleep-schedule and ensuring we do sleep for sufficient time (probably longer than current habit). -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Configuring an object via a dictionary

2024-03-17 Thread dn via Python-list
On 18/03/24 04:11, Peter J. Holzer via Python-list wrote: On 2024-03-17 17:15:32 +1300, dn via Python-list wrote: On 17/03/24 12:06, Peter J. Holzer via Python-list wrote: On 2024-03-16 08:15:19 +, Barry via Python-list wrote: On 15 Mar 2024, at 19:51, Thomas Passin via Python-list

Re: MTG: Introductions to PyQt and DataClasses

2024-03-17 Thread Jim Schwartz via Python-list
Actually, I have a sleep disorder that requires me to keep a constant sleep schedule. Thats why I asked. Sent from my iPhone > On Mar 17, 2024, at 3:36 PM, dn via Python-list > wrote: > > On 17/03/24 23:40, Jim Schwartz wrote: >> Will it be recorded? > > Bett

Re: MTG: Introductions to PyQt and DataClasses

2024-03-17 Thread dn via Python-list
On 17/03/24 23:40, Jim Schwartz wrote: Will it be recorded? Better than that (assumption) "coming soon" - please join-up or keep an eye on PySprings' Meetup ANNs: https://www.meetup.com/pysprings/ On Mar 17, 2024, at 1:47 AM, dn via Python-list wrote: The Auckland Branch of N

Re: Configuring an object via a dictionary

2024-03-17 Thread Peter J. Holzer via Python-list
On 2024-03-17 17:15:32 +1300, dn via Python-list wrote: > On 17/03/24 12:06, Peter J. Holzer via Python-list wrote: > > On 2024-03-16 08:15:19 +, Barry via Python-list wrote: > > > > On 15 Mar 2024, at 19:51, Thomas Passin via Python-list > > > > wrote: >

Re: MTG: Introductions to PyQt and DataClasses

2024-03-17 Thread Jim Schwartz via Python-list
Will it be recorded? Sent from my iPhone > On Mar 17, 2024, at 1:47 AM, dn via Python-list > wrote: > > The Auckland Branch of NZPUG meets this Wednesday, 20 March at 1830 NZDT > (0530 UTC, midnight-ish Tue/Wed in American time-zones), for a virtual > meeting.

MTG: Introductions to PyQt and DataClasses

2024-03-17 Thread dn via Python-list
). A head-set will facilitate asking questions but text-chat will be available. Please RSVP at https://www.meetup.com/nzpug-auckland/events/299764049/ See you there! =dn, Branch Leader -- https://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >