Re: Fallback for operator and other dunder methods

2023-07-26 Thread Dieter Maurer via Python-list
dingProxy` (--> `dm.reuse` on PyPI). -- https://mail.python.org/mailman/listinfo/python-list

Re: Fallback for operator and other dunder methods

2023-07-26 Thread Dom Grigonis via Python-list
Tried exactly that and didn’t work. Neither __getattr__, nor __getattribute__ of meta is being invoked. > On 26 Jul 2023, at 10:01, Chris Angelico via Python-list > wrote: > > On Wed, 26 Jul 2023 at 16:52, Dom Grigonis wrote: >> >> Could you give an example? Someth

Re: isinstance()

2023-08-02 Thread Cameron Simpson via Python-list
e) There's similar language in this try/except documentation: file:///Users/cameron/var/doc/python/3.8.0/reference/compound_stmts.html#index-10 For an except clause with an expression, that expression is evaluated, and the clause matches the exception if the resulting object

How to find the full class name for a frame

2023-08-03 Thread Jason Friedman via Python-list
without quotations) is not recognized, Nor is inspect.frame. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to find the full class name for a frame

2023-08-04 Thread Jason Friedman via Python-list
> My question is: let's say I wanted to add a type hint for my_frame. > > > > my_frame: some_class_name = inspect.currentframe() > > > > What would I put for some_class_name? > > "frame" (without quotations) is not recognized, > > Nor is in

Re: isinstance()

2023-08-04 Thread Jon Ribbens via Python-list
oad to recursion and stack overflow. */ https://github.com/python/cpython/blob/main/Objects/abstract.c#L2684 Plus an almost total lack of demand for change I should think. -- https://mail.python.org/mailman/listinfo/python-list

Re: Fallback for operator and other dunder methods

2023-08-04 Thread Edmondo Giovannozzi via Python-list
Il giorno mercoledì 26 luglio 2023 alle 20:35:53 UTC+2 Dom Grigonis ha scritto: > Tried exactly that and didn’t work. Neither __getattr__, nor __getattribute__ > of meta is being invoked. > > On 26 Jul 2023, at 10:01, Chris Angelico via Python-list > > wrote: > > >

Re: Fallback for operator and other dunder methods

2023-08-04 Thread Dom Grigonis via Python-list
cases. Well, at least it’s what I got to. __getattr__ feels very hacky for such case, so maybe it’s for the best. > On 2 Aug 2023, at 19:54, Edmondo Giovannozzi via Python-list > wrote: > > Il giorno mercoledì 26 luglio 2023 alle 20:35:53 UTC+2 Dom Grigonis ha > scritto: &

Re: How to find the full class name for a frame

2023-08-04 Thread Dieter Maurer via Python-list
Jason Friedman wrote at 2023-8-3 21:34 -0600: > ... >my_frame = inspect.currentframe() > ... >My question is: let's say I wanted to add a type hint for my_frame. `my_frame` will be an instance of `Types.FrameType`. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to find the full class name for a frame

2023-08-04 Thread Jason Friedman via Python-list
ank you! -- https://mail.python.org/mailman/listinfo/python-list

Re: isinstance()

2023-08-04 Thread Chris Angelico via Python-list
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 collecti

Re: isinstance()

2023-08-04 Thread Chris Angelico via Python-list
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 > r

Re: isinstance()

2023-08-04 Thread Grant Edwards via Python-list
On 2023-08-04, Chris Angelico via Python-list wrote: > 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. >

[RELEASE] Python 3.12.0 release candidate 1 released

2023-08-06 Thread Thomas Wouters via Python-list
I'm pleased to announce the release of Python 3.12.0rc1: https://www.python.org/downloads/release/python-3120rc1/ This is the first release candidate of Python 3.12.0 This release, *3.12.0rc1*, is the penultimate release preview. Entering the release candidate phase, only reviewed code ch

Re: Where is the error?

2023-08-06 Thread Cameron Simpson via Python-list
On 06Aug2023 22:41, Peter J. Holzer wrote: Mostly, error messages got a lot better in Python 3.10, but this one had me scratching my head for a few minutes. Consider this useless and faulty script: r = { "x&quo

Re: Where is the error?

2023-08-07 Thread Cameron Simpson via Python-list
On 07Aug2023 08:02, Barry wrote: On 7 Aug 2023, at 05:28, Cameron Simpson via Python-list wrote: Used to use a Pascal compiler once which was uncannily good at suggesting where you'd missing a semicolon. Was that on DEC VMS? It was a goal at DEC for its compilers to do this well.

Re: Where is the error?

2023-08-07 Thread Michael Agbenike via Python-list
When i try to open a python script it either says theres no ctk module or no pip On Sun, Aug 6, 2023, 3:51 PM Peter J. Holzer via Python-list < [email protected]> wrote: > Mostly, error messages got a lot better in Python 3.10, but this one had > me scratching my head for a

Cheetah 3.3.2

2023-08-08 Thread Oleg Broytman via Python-list
: - CI(GHActions): Install all Python and PyPy versions from ``conda-forge``. What is CheetahTemplate3 Cheetah3 is a free and open source (MIT) Python template engine. It's a fork of the original CheetahTemplate library. Python 2.7 or 3.4+ is required. Where is C

Planning a Python / PyData conference

2023-08-08 Thread Wilber H via Python-list
Hi, I would like to plan a Python / PyData conference in the country of the Dominican Republic, and would like your feedback on how to best plan for the conference. Regards, Wilber Hernandez 1-201-220-7082 -- https://mail.python.org/mailman/listinfo/python-list

zoneinfo and tzdata

2023-08-08 Thread Mike Dewhirst via Python-list
nded it should raise an error saying no timezone information was found? Currently, it just nominates the timezone key you attempt to use. Behind the scenes it surely knows there are no such keys. In that case it might suggest installing tzdata. Cheers Mike -- https://mail.python.org/mailman/listinfo/python-list

SQLObject 3.10.2

2023-08-09 Thread Oleg Broytman via Python-list
orated bug report. For a more complete list, please see the news: http://sqlobject.org/News.html What is SQLObject = SQLObject is a free and open-source (LGPL) Python object-relational mapper. Your database tables are described as classes, and rows are instances of those classes.

Imports and dot-notation

2023-08-09 Thread Oliver Schinagl via Python-list
Dear list, First a disclaimer, I am a python novice ;) so apologies beforehand for any incorrect terms and use thereof :) I have a question about the preferred/pythonic way dealing with imports. But let me start by giving a little bit of an example (which lead me to this question

Re: Planning a Python / PyData conference

2023-08-09 Thread Fulian Wang via Python-list
I recommend Sichuan ,Taiwan , or Thailand Get Outlook for iOS<https://aka.ms/o0ukef> From: Python-list on behalf of dn via Python-list Sent: Wednesday, August 9, 2023 00:10 To: [email protected] Subject: Re: Planning a Python / PyData conferen

Re: Imports and dot-notation

2023-08-09 Thread Cameron Simpson via Python-list
On 09Aug2023 12:30, Oliver Schinagl wrote: Looking at a python projects code and repository layout, we see the following directory structure. /project/core /project/components/module1 ... /project/components/moduleN /projects/util (this is far from complete, but enough to help paint a

Re: Imports and dot-notation

2023-08-10 Thread Mats Wichmann via Python-list
On 8/9/23 17:28, dn via Python-list wrote: Side note: Using "...import identifier, ..." does not save storage-space over "import module" (the whole module is imported regardless, IIRC), however it does form an "interface" and thus recommend leaning into the &q

problems installing Python 3.11

2023-08-10 Thread Bernd Lentes via Python-list
Hi ML, i hope this is the right place for my question. If not please tell me where I can ask. I tried to install python 3.11.4 on a SLES 15 SP5. ./configure ran fine, just one package missing. Installed the package, configure ran fine with complaints. make was ok, make test not. This is what I

Re: Planning a Python / PyData conference

2023-08-10 Thread Fulian Wang via Python-list
source. Anyone is interested please contact Ms. Wang (832)208-3196 [email protected] Get Outlook for iOS<https://aka.ms/o0ukef> From: Fulian Wang Sent: Wednesday, August 9, 2023 1:14:23 PM To: dn ; [email protected] Subject: Re: Planning a

RE: problems installing Python 3.11

2023-08-11 Thread Bernd Lentes via Python-list
>-Original Message- >From: Terry Reedy >Sent: Thursday, August 10, 2023 9:55 PM >To: Bernd Lentes >Subject: Re: problems installing Python 3.11 > >On 8/10/2023 3:28 PM, Bernd Lentes via Python-list wrote: > >Private response because cannot post at present. >

RE: problems installing Python 3.11

2023-08-11 Thread Bernd Lentes via Python-list
>-Original Message- >From: Python-list [email protected]> On Behalf Of Bernd Lentes via Python-list >Sent: Friday, August 11, 2023 12:01 PM >To: Terry Reedy >Cc: Python ML ([email protected]) >Subject: RE: problems installing Python 3.11 Hi, I read the

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread Dieter Maurer via Python-list
[email protected] wrote at 2023-8-17 07:10 +: >I want to display one string in its original source (untranslated) >version and in its translated version site by site without duplicating >the string in the python source code? Is it an option for you to replace the `gettext` b

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread Richard Damon via Python-list
> On Aug 17, 2023, at 10:02 AM, c.buhtz--- via Python-list > wrote: > > X-Post: https://stackoverflow.com/q/76913082/4865723 > > I want to display one string in its original source (untranslated) version > and in its translated version site by site without duplicating

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread Dieter Maurer via Python-list
[email protected] wrote at 2023-8-17 07:10 +: >I want to display one string in its original source (untranslated) >version and in its translated version site by site without duplicating >the string in the python source code? You could try to translate into an unknown language: th

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread Greg Ewing via Python-list
il.python.org/mailman/listinfo/python-list

Near and far clip plane in glowscript

2023-08-20 Thread Poul Riis via Python-list
solution. It would make me very, very happy! Poul Riis Denmark -- https://mail.python.org/mailman/listinfo/python-list

ANN: eGenix Antispam Bot for Telegram 0.5.0

2023-08-21 Thread eGenix Team via Python-list
-GA.html *INTRODUCTION* eGenix <https://egenix.com/> has long been running a local Python user group meeting in Düsseldorf called /Python Meeting Düsseldorf <https://pyddf.de/>/ and we are using a Telegram group for

divmod with negative Decimal values

2023-08-21 Thread Rob Cliffe via Python-list
I am using Python 3.11.4. Can anyone explain why Decimal values behave differently from ints when negative values are used in divmod as follows: >>> divmod(-1, 60) (-1, 59)  # as expected >>> divmod(Decimal("-1"),

Getty fully qualified class name from class object

2023-08-22 Thread Ian Pilcher via Python-list
- Google Where SkyNet meets Idiocracy ==== -- https://mail.python.org/mailman/listinfo/python-list

Re: Getty fully qualified class name from class object

2023-08-22 Thread Greg Ewing via Python-list
On 23/08/23 2:45 am, Ian Pilcher wrote: How can I programmatically get 'logging.Handler' from the class object? Classes have a __module__ attribute: >>> logging.Handler.__module__ 'logging' -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: divmod with negative Decimal values

2023-08-22 Thread Thomas Passin via Python-list
On 8/18/2023 5:14 AM, Rob Cliffe via Python-list wrote: divmod(Decimal("-1"), 60) It's not divmod per se, but the modulus operation: from decimal import Decimal D1 = Decimal(-1) D1 % 60 # Decimal(-1) fmod() performs the same way: from math import fmod fmod(-1, 60) # -1.0

Context manager for database connection

2023-08-23 Thread Jason Friedman via Python-list
t; jdbc.Connection: return self.database_connection -- https://mail.python.org/mailman/listinfo/python-list

Re: Getty fully qualified class name from class object

2023-08-23 Thread Ian Pilcher via Python-list
On 8/22/23 11:13, Greg Ewing via Python-list wrote: Classes have a __module__ attribute: >>> logging.Handler.__module__ 'logging' Not sure why I didn't think to look for such a thing. Looks like it's as simple as f'{cls.__modu

Collecting unassigned Expressions

2023-08-24 Thread Guenther Sohler via Python-list
Hi I am wondering If an embedded Python Interpreter can detect unassigned Expressions. Cases where functions Return values but they are Not assignwd. E.g. Calc_square(4) Or 3*4-myval() Thank you for your hints -- https://mail.python.org/mailman/listinfo/python-list

[RELEASE] Python 3.11.5, 3.10.13, 3.9.18, and 3.8.18 is now available

2023-08-24 Thread Łukasz Langa via Python-list
There’s security content in the releases, let’s dive right in. gh-108310 <https://github.com/python/cpython/issues/108310>: Fixed an issue where instances of ssl.SSLSocket <https://docs.python.org/release/3.10.13/library/ssl.html#ssl.SSLSocket> were vulnerable to a bypass of the T

Generating documentation with Sphinx

2023-08-28 Thread Jason Friedman via Python-list
f1:construct_response` but that gives an undefined label warning. -- https://mail.python.org/mailman/listinfo/python-list

Re: Generating documentation with Sphinx

2023-08-28 Thread Jason Friedman via Python-list
uct_response function? > > > I tried: > :ref:`my_project/api/stuff1:construct_response` > > but that gives an undefined label warning. > I can answer my own Question 1: :func:`construct_response` -- https://mail.python.org/mailman/listinfo/python-list

Re: Generating documentation with Sphinx

2023-08-28 Thread Jason Friedman via Python-list
gt;> >> Question 1: how do I embed in the serve function docstring a link to the >> construct_response function? >> >> >> Question 2: how do I embed in, for example, lib/stuff3.py, a link to the >> construct_response function? >> >> >> I tried: >> :ref:`my_project/api/stuff1:construct_response` >> >> but that gives an undefined label warning. >> > > I can answer my own Question 1: > :func:`construct_response` > -- https://mail.python.org/mailman/listinfo/python-list

Re: Generating documentation with Sphinx

2023-08-28 Thread Jason Friedman via Python-list
t;> Question 2: how do I embed in, for example, lib/stuff3.py, a link to the >> construct_response function? >> >> >> I tried: >> :ref:`my_project/api/stuff1:construct_response` >> >> but that gives an undefined label warning. >> > > I can answer my own Question 1: > :func:`construct_response` > And I can answer my own Question 2: :func:`my_project.main_application.construct_response` -- https://mail.python.org/mailman/listinfo/python-list

f-string error message

2023-08-30 Thread Rob Cliffe via Python-list
I am currently using Python 3.11.4. First I want to say: f-strings are great!  I use them all the time, mostly but by no means exclusively for debug messages.  And in 3.12 they will get even better. And the improved error messages in Python (since 3.9) are great too!  Keep up the good work

What sort of exception when a class can't find something?

2023-08-31 Thread Chris Green via Python-list
name. person.Person('Fred') ... ... If Fred doesn't exist in the database what sort of exception should there be? Is it maybe a ValueError? -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: What sort of exception when a class can't find something?

2023-08-31 Thread Chris Angelico via Python-list
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 n

Re: What sort of exception when a class can't find something?

2023-08-31 Thread Chris Green via Python-list
Several helpful replies, thank you all. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Chris Green via Python-list
tinfo/python-list

Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Chris Green via Python-list
recent call last): File "", line 1, in File "/home/chris/.cfg/hosts/bbb/bin/ngp.py", line 24, in __init__ return ValueError: Can't find pin 'P9_23' >>> Does a return in __init__() not do what I think it does? How else could/should I do this? -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Larry Martell via Python-list
On Thu, Aug 31, 2023 at 3:19 PM Chris Green via Python-list wrote: > > I'm obviously doing something very silly here but at the moment I > can't see what. > > Here's the code:- > > #!/usr/bin/python3 > # > # > # GPIO > # &

Re: Why do I always get an exception raised in this __init__()?

2023-09-01 Thread Alan Gauld via Python-list
On 31/08/2023 22:15, Chris Green via Python-list wrote: > class Gpiopin: > > def __init__(self, pin): > # > # > # scan through the GPIO chips to find the line/pin we want > # > for c in

Forward References

2023-09-03 Thread Jonathan Gossage via Python-list
: TypeAlias = RGB | int | str @dataclass(frozen=True, slots=True) class RGB(object): Can anyone suggest how I should fix this without reversing the statement order? pass -- Jonathan Gossage -- https://mail.python.org/mailman/listinfo/python-list

Re: Why do I always get an exception raised in this __init__()?

2023-09-03 Thread Chris Green via Python-list
Alan Gauld wrote: > On 31/08/2023 22:15, Chris Green via Python-list wrote: > > > class Gpiopin: > > > > def __init__(self, pin): > > # > > # > > # scan through the GPIO chips to find the line/pin we wa

iterations destroy reversed() results

2023-09-03 Thread Pierre Fortin via Python-list
for x in rev ] ) # list comprehension was an iteration over 'rev' print( 'after iteration:', [ x for x in rev ] ) # how this was discovered... orig = [ 'x', 'a', 'y', 'b', 'z', 'c' ] rev = reversed(orig) cr = sum( 1 for

Finding good documentation for gpiod

2023-09-03 Thread Chris Green via Python-list
dard' way of finding out parameter information? It may well be that I'm simply banging up against the limit of what documentation is available, I have managed to get code working OK. It's just that I'd be happier if I really know what I was doing! :-) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: iterations destroy reversed() results

2023-09-03 Thread Dom Grigonis via Python-list
ins a lot of such functions and many good recipes on achieving various things elegantly using iterators. > On 1 Sep 2023, at 19:15, Pierre Fortin via Python-list > wrote: > > Hi, > > reversed() results are fine until iterated over, after which the > results are no

Re: iterations destroy reversed() results

2023-09-03 Thread Thomas Passin via Python-list
On 9/1/2023 12:15 PM, 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 ) # rev is now

Re: Passing info to function used in re.sub

2023-09-03 Thread Thomas Passin via Python-list
On 9/3/2023 12:10 PM, Jan Erik Moström via Python-list wrote: I'm looking for some advice for how to write this in a clean way I want to replace some text using a regex-pattern, but before creating replacement text I need to some file checking/copying etc. My code right now look some

Re: iterations destroy reversed() results

2023-09-03 Thread Chris Angelico via Python-list
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 ) ) &g

Re: Passing info to function used in re.sub

2023-09-04 Thread Dieter Maurer via Python-list
sume there is a >better way to write this, but how? You could define a class with a `__call__` method and use an instance of the class as replacement. The class and/or instance can provide all relevant information via attributes. -- https://mail.python.org/mailman/listinfo/python-list

Displaying CPU instruction sets used for TensorFlow build?

2023-09-05 Thread Loris Bennett via Python-list
m has some sort of problem. Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

Python 3.12.0 rc2 (final release candidate) now available.

2023-09-06 Thread Thomas Wouters via Python-list
I'm pleased to announce the release of Python 3.12 release candidate 2. https://www.python.org/downloads/release/python-3120rc2/ This is the second release candidate of Python 3.12.0 This release, *3.12.0rc2*, is the last release preview for Python 3.12. There will be *no ABI changes*

Tkinter ttk Treeview binding responds to past events!

2023-09-11 Thread John O'Hagan via Python-list
ound this by using a regular button-click binding for selection instead, but I'm curious if anyone can cast any light on this. Cheers John -- https://mail.python.org/mailman/listinfo/python-list

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-11 Thread Rob Cliffe via Python-list
On 11/09/2023 21:25, Mirko via Python-list wrote: Am 11.09.23 um 14:30 schrieb John O'Hagan via Python-list: I was surprised that the code below prints 'called' three times. from tkinter import * from tkinter.ttk import * root=Tk() def callback(*e):      print('calle

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-12 Thread John O'Hagan via Python-list
On Mon, 2023-09-11 at 22:25 +0200, Mirko via Python-list wrote: > Am 11.09.23 um 14:30 schrieb John O'Hagan via Python-list: > > I was surprised that the code below prints 'called' three times. > > > > > > from tkinter import * > > from tkin

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-12 Thread Rob Cliffe via Python-list
On 12/09/2023 19:51, Mirko via Python-list wrote: I have also found that after() is a cure for some ills, though I avoid using it more than I have to because it feels ... a bit fragile, perhaps. Yeah. Though for me it was the delay which made it seem fragile. With a 0 delay, this looks

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-12 Thread John O'Hagan via Python-list
On Tue, 2023-09-12 at 20:51 +0200, Mirko via Python-list wrote: > Am 12.09.23 um 07:43 schrieb John O'Hagan via Python-list: > > > My issue is solved, but I'm still curious about what is happening > > here. > > MRAB already said it: When you enter the callbac

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-12 Thread John O'Hagan via Python-list
On Wed, 2023-09-13 at 01:33 +0100, MRAB via Python-list wrote: > On 2023-09-13 00:40, John O'Hagan via Python-list wrote: > > On Tue, 2023-09-12 at 20:51 +0200, Mirko via Python-list wrote: > > > Am 12.09.23 um 07:43 schrieb John O'Hagan via Python-list: > >

Python 3.11.5 Pip Issue

2023-09-14 Thread Jacob Keeler via Python-list
I downloaded Python 3.11.5, and there was nothing in the “Scripts” file, and there was no Pip. I would like to know why. Thank you, Jacob -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.11.5 Pip Issue

2023-09-14 Thread Skip Montanaro via Python-list
> I downloaded Python 3.11.5, and there was nothing in the “Scripts” file, > and there was no Pip. I would like to know why. > Can't help with the empty/missing Scripts folder. Does running python -m ensurepip get you a working pip? Which you should then run as python -m

Re: Python 3.11.5 Pip Issue

2023-09-14 Thread Thomas Passin via Python-list
On 9/13/2023 11:39 PM, Jacob Keeler via Python-list wrote: I downloaded Python 3.11.5, and there was nothing in the “Scripts” file, and there was no Pip. I would like to know why. What do you mean by "downloaded"? And are you talking about Windows? Did you download the inst

Re: Python 3.11.5 Pip Issue

2023-09-14 Thread Thomas Passin via Python-list
On 9/13/2023 11:39 PM, Jacob Keeler via Python-list wrote: I downloaded Python 3.11.5, and there was nothing in the “Scripts” file, and there was no Pip. I would like to know why. I just downloaded the 3.11.5 64-bit installer for Windows from python.org and ran it. This was an upgrade since

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 &q

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

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

2023-09-15 Thread Clara Spealman via Python-list
On Fri, Sep 15, 2023 at 6:53 AM scruel tao via Python-list < [email protected]> wrote: > ```python > >>> class A: > ... def __init__(self): > ... pass > ... > >>> A.__init__ > > >>> a = A() > >>> a.__init__ > > &

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 >

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

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

2023-09-16 Thread Karsten Hilbert via Python-list
Am Sat, Sep 16, 2023 at 02:17:19PM +1200 schrieb Rimu Atkinson via Python-list: > Everyone uses virtual environments. Umm, like, no. Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https://mail.python.org/mailman/listinfo/python-list

RE: Postgresql equivalent of Python's timeit?

2023-09-17 Thread AVI GROSS via Python-list
may have trouble duplicating the results with a somewhat different setup. -Original Message- From: Python-list On Behalf Of Albert-Jan Roskam via Python-list Sent: Sunday, September 17, 2023 5:02 AM To: Peter J. Holzer Cc: [email protected] Subject: Re: Postgresql equivalent of

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 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

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 ca

subprocess: TTYs and preexec_fn

2023-09-17 Thread Antonio Russo via Python-list
open-compatible interface? 2. Is this preexec_fn sufficiently simple that it does not run afoul of the big, scary threading warning of _posixsubprocess.fork_exec ? I.e., I'm not touching any locks (besides the GIL... but I'm assuming that would be properly handled?). CAN this be made safe

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

2023-09-17 Thread Rimu Atkinson via Python-list
vironments can use a different version of python than the system one. If you need an earlier version of python then you can use it instead. The second problem can be avoided because virtual environments exist in a part of the file system that you have write access to, so you don't need

Async options for flask app

2023-09-17 Thread Rimu Atkinson via Python-list
ypi.org/project/quart/ How well does gevent monkey-patch into a Flask app? A penny for your thoughts Thanks! R -- https://mail.python.org/mailman/listinfo/python-list

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 wor

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

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 -- https://mail.python.or

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 COURS

Re: Confusing behavior of PYTHONWARNINGS

2023-09-18 Thread Roel Schroeven via Python-list
Op 16/09/2023 om 10:17 schreef 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 var

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

2023-09-18 Thread Roel Schroeven via Python-list
Op 15/09/2023 om 15:05 schreef anthony.flury via Python-list: Like all of the other methods you shouldn't ever need to call them directly : these are called dunder methods and represent functions and features which are called by other operators. The only recommended way to c

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

2023-09-18 Thread scruel tao via Python-list
let's still remember: All methods are functions, but not every function is a method. Thanks again for helping, you guys are really nice! -- https://mail.python.org/mailman/listinfo/python-list

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

2023-09-18 Thread Mats Wichmann via Python-list
On 9/18/23 02:16, Peter J. Holzer via Python-list wrote: On 2023-09-15 14:15:23 +, c.buhtz--- via Python-list wrote: I tried to install it via "pipx install -e .[develop]". It's pyproject.toml has a bug: A missing dependency "dateutil". But "dateutil" is

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

2023-09-18 Thread Mats Wichmann via Python-list
On 9/18/23 12:56, c.buhtz--- via Python-list wrote: On 2023-09-18 10:16 "Peter J. Holzer via Python-list" wrote: On 2023-09-15 14:15:23 +, c.buhtz--- via Python-list wrote: I tried to install it via "pipx install -e .[develop]". It's pyproject.toml has a

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

2023-09-18 Thread Thomas Passin via Python-list
On 9/18/2023 2:56 PM, c.buhtz--- via Python-list wrote: On 2023-09-18 10:16 "Peter J. Holzer via Python-list" wrote: On 2023-09-15 14:15:23 +, c.buhtz--- via Python-list wrote: I tried to install it via "pipx install -e .[develop]". It's pyproject.toml has a

Python 3.12.0 rc3 (final release candidate I promise!) now available

2023-09-19 Thread Thomas Wouters via Python-list
I'm pleased to announce the release of Python 3.12 release candidate 3. https://www.python.org/downloads/release/python-3120rc3/ This is the second release candidate of Python 3.12.0 This release, *3.12.0rc3*, is the absolutely last release preview for Python 3.12. There will be *n

<    25   26   27   28   29   30   31   32   33   34   >