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

2023-09-15 Thread c.buhtz--- via Python-list
Dear Rimu, thanks for your reply. I'm willing to learn for sure. On 2023-09-16 14:17 Rimu Atkinson via Python-list wrote: > There's your problem - everything else is a result of this. There is > just no nice way to work with a combination of pypi, apt-get and > system-wide python. > > Everyon

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

2023-09-15 Thread Rimu Atkinson via Python-list
I never used virtual environments and wouldn't like to start with it. There's your problem - everything else is a result of this. There is just no nice way to work with a combination of pypi, apt-get and system-wide python. Everyone uses virtual environments. Sorry. -- https://mail.pyt

`time.perf_counter_ns` always a 64-bit int?

2023-09-15 Thread rmlibre--- via Python-list
I'd like to capture the output of `time.perf_counter_ns()` as an 8-byte timestamp. I'm aware that the docs provide an undefined start value for that clock. I'm going to assume that means it can't be expected to fit within 8 bytes. However, it would be rather convenient if it could. Does anyone kno

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

2023-09-15 Thread Alan Gauld via Python-list
On 15/09/2023 11:49, scruel tao via Python-list 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". That' because in OOP term

Re: Postgresql equivalent of Python's timeit?

2023-09-15 Thread Peter J. Holzer via Python-list
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 Python timeit >(https://docs.python.org/3/library/timeit.html). I know about EXPLAIN >

Postgresql equivalent of Python's timeit?

2023-09-15 Thread Albert-Jan Roskam via Python-list
Hi, This is more related to Postgresql than to Python, I hope this is ok. I want to measure Postgres queries N times, much like Python timeit (https://docs.python.org/3/library/timeit.html). I know about EXPLAIN ANALYZE and psql \timing, but there's quite a bit of variation in the

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

2023-09-15 Thread Clara Spealman via Python-list
All methods are functions, but not all functions are methods. All methods are functions in the namespace of a class and when resolved from the class directly, you'll get the original function. Its only when resolved from an *instance* of the class, as in self.__init__ or self.any_other_method(), th

PEP668 / pipx and "--editable" installs

2023-09-15 Thread c.buhtz--- via Python-list
Hello, I wonder that today was the first day I stumbled over PEP668 / pipx and the "externally-managed-environment" problem. I migrated from Debian 11 to 12. I'm developing some Python packages; applications and libraries. I never used virtual environments and wouldn't like to start with it.

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

2023-09-15 Thread Dan Sommers via Python-list
On 2023-09-15 at 10:49:10 +, scruel tao via Python-list wrote: > ```python > >>> class A: > ... def __init__(self): > ... pass > ... > >>> A.__init__ > > >>> a = A() > >>> a.__init__ > > > ``` > > On many books and even the official documents, it seems that many authors > prefer to c

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

2023-09-15 Thread scruel tao via Python-list
```python >>> class A: ... def __init__(self): ... pass ... >>> A.__init__ >>> a = A() >>> a.__init__ > ``` 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 th