Re: PEP668 / pipx and "--editable" installs

2023-09-17 Thread c.buhtz--- via Python-list
Thanks for your reply. btw: I do know what a virtual environment is and how its works. No need to explain. And again: I do expect "pipx" to use virtual environments. So this thread is not about pro and cons of using virtual environments. On 2023-09-17 11:57 Rimu Atkinson via Python-list wrote: >

Re: Why doc call `__init__` as a method rather than function?

2023-09-17 Thread Cameron Simpson via Python-list
On 15Sep2023 10:49, scruel tao wrote: ```python class A: ... def __init__(self): ... pass ... ``` On many books and even the official documents, it seems that many authors prefer to call `__init__` as a "method" rather than a "function". The book PYTHON CRASH COURSE mentioned that "A

Re: Why doc call `__init__` as a method rather than function?

2023-09-17 Thread Chris Angelico via Python-list
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 --

Re: PEP668 / pipx and "--editable" installs

2023-09-17 Thread Thomas Passin via Python-list
On 9/16/2023 7:57 PM, Rimu Atkinson via Python-list wrote: It is nothing bad about using virtual environments but also not about not using them. In my own work I haven't see a use case where I needed them. And I expect that some day I'll encounter a use case for it. This here is not about pro

Re: Async options for flask app

2023-09-17 Thread Chris Angelico via Python-list
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

Re: Why doc call `__init__` as a method rather than function?

2023-09-17 Thread anthony.flury via Python-list
To me __init__ is a method, but that is implemented internally as function associated to a class When you use A.__init__ on it's own and inspect it, then it will show that it is a function object - this is expected. The implementation internals of the runtime don't need to have a special

Async options for flask app

2023-09-17 Thread Rimu Atkinson via Python-list
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. This architecture involves a lot of inter-server communication, potentially involving thousands of

Re: PEP668 / pipx and "--editable" installs

2023-09-17 Thread Rimu Atkinson via Python-list
It is nothing bad about using virtual environments but also not about not using them. In my own work I haven't see a use case where I needed them. And I expect that some day I'll encounter a use case for it. This here is not about pro and cons of virtual environments. You are in a use case

subprocess: TTYs and preexec_fn

2023-09-17 Thread Antonio Russo via Python-list
Hello! I'm trying to run a subprocess (actually several), and control their terminals (not just stdin and stdout). I have a use case, but I won't bore everyone with those details. I'd rather not use pexpect or ptyprocess, because those expose a very different interface than Popen. I've mostly

Confusing behavior of PYTHONWARNINGS

2023-09-17 Thread Meowxiik via Python-list
Hello, For the third time I am trying to work with `PYTHONWARNINGS` filter, and for the third time I am having a terrible time. I'd like to seek your assistance, I have a few questions: **Question 1:** Does the environment variable only matter at python interpreter startup time? If I set

Python Launcher Pops Up When Py-based App Is Running (Mac)

2023-09-17 Thread James Greenham via Python-list
Hello, On the face of it, the Python-Mac mailing list is largely inactive so I'm posting here since it looks like this one is livelier. I'm running macOS Mojave with Python 2.7. I have an old Dashboard widget (last modified in 2009) that appears to use Python as well. The widget captures the

Re: Postgresql equivalent of Python's timeit?

2023-09-17 Thread Thomas Passin via Python-list
On 9/17/2023 5:01 AM, Albert-Jan Roskam via Python-list wrote: On Sep 15, 2023 19:45, "Peter J. Holzer via Python-list" wrote: On 2023-09-15 17:42:06 +0200, Albert-Jan Roskam via Python-list wrote: >    This is more related to Postgresql than to Python, I hope this is

Re: Postgresql equivalent of Python's timeit?

2023-09-17 Thread Peter J. Holzer via Python-list
On 2023-09-17 11:01:43 +0200, Albert-Jan Roskam via Python-list wrote: >On Sep 15, 2023 19:45, "Peter J. Holzer via Python-list" > wrote: > > On 2023-09-15 17:42:06 +0200, Albert-Jan Roskam via Python-list wrote: > >    This is more related to Postgresql than to Python, I hope

Re: Postgresql equivalent of Python's timeit?

2023-09-17 Thread Thomas Passin via Python-list
On 9/17/2023 11:48 AM, AVI GROSS via Python-list wrote: Timing things that are fairly simple is hard enough to do repeatedly, but when it involves access to slower media and especially to network connections to servers, the number of things that can change are enormous. There are all kinds of

RE: Postgresql equivalent of Python's timeit?

2023-09-17 Thread AVI GROSS via Python-list
Timing things that are fairly simple is hard enough to do repeatedly, but when it involves access to slower media and especially to network connections to servers, the number of things that can change are enormous. There are all kinds of caching at various levels depending on your hardware and

Re: Postgresql equivalent of Python's timeit?

2023-09-17 Thread Albert-Jan Roskam via Python-list
On Sep 15, 2023 19:45, "Peter J. Holzer via Python-list" wrote: On 2023-09-15 17:42:06 +0200, Albert-Jan Roskam via Python-list wrote: >    This is more related to Postgresql than to Python, I hope this is ok. >    I want to measure Postgres queries N times, much like