Re: Canonical list of Python security vulnerabilities

2023-07-15 Thread Dieter Maurer via Python-list
eports whether found by the Pyhton community or packagers. For details about CVE, read "https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures";. -- https://mail.python.org/mailman/listinfo/python-list

Setup-tools

2023-07-15 Thread YOUSEF EZZAT via Python-list
b4 -- https://mail.python.org/mailman/listinfo/python-list

Re: Canonical list of Python security vulnerabilities

2023-07-15 Thread Bob Kline via Python-list
pus of JSON CVEs and I'm digging into what would be involved in querying it myself. Cheers, Bob -- https://mail.python.org/mailman/listinfo/python-list

Working with paths

2023-07-16 Thread Peter Slížik via Python-list
str() as path: print("string") case bytes() as path: print("bytes") case os.PathLike() as path: print("os.PathLike") Should I branch on the individual types or is there a more elegant way? Peter -- https://mail.python.org/mailman/listinfo/python-list

Re: Setup-tools

2023-07-16 Thread Mats Wichmann via Python-list
On 7/15/23 12:56, MRAB via Python-list wrote: On 2023-07-15 07:12, YOUSEF EZZAT via Python-list wrote: Hey!. i face a problem when i get setup packages by pip when i code this : "pip install numpy" in my command line it gives me error "ModuleNotFoundError: No module n

Re: Working with paths

2023-07-16 Thread Kushal Kumaran via Python-list
as possible. In the main body of your code, it should be able to rely on all paths being Path objects. -- regards, kushal -- https://mail.python.org/mailman/listinfo/python-list

Announcement: distlib 0.3.7 released on PyPI

2023-07-17 Thread Vinay Sajip via Python-list
3]. Regards, Vinay Sajip [1] https://pypi.org/project/distlib/0.3.7/ [2] https://distlib.readthedocs.io/en/0.3.7/overview.html#change-log-for-distlib [3] https://github.com/pypa/distlib/issues/new/choose -- https://mail.python.org/mailman/listinfo/python-list

pip-sync

2023-07-21 Thread Larry Martell via Python-list
stall 'apparmor'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. Since it's not installed in the venv why does it want to uninstall it? -- https://mail.python.org/mailman/listinfo/python-list

ANN: A new version (0.5.1) of python-gnupg has been released.

2023-07-22 Thread Vinay Sajip via Python-list
ocs.red-dove.com/python-gnupg/ -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: A new version (0.5.1) of python-gnupg has been released.

2023-07-22 Thread Dan Sommers via Python-list
On 2023-07-22 at 11:04:35 +, Vinay Sajip via Python-list wrote: > What Changed? > = What changed, indeed. Maybe I'm old, and curmudgeonly, but it would be nice if the body of these annoucement emails (not just this one) contained the name of the program and a one-l

Meta Class Maybe?

2023-07-22 Thread Chris Nyland via Python-list
the __new__ and __prepare__ methods and I can't seem to make anything work and the examples of meta classes don't clearly show how to convert my type example to a class structure. Is what I want to do possible? Chris -- https://mail.python.org/mailman/listinfo/python-list

Re: Meta Class Maybe?

2023-07-23 Thread Dieter Maurer via Python-list
sed to check/update the newly created class. -- https://mail.python.org/mailman/listinfo/python-list

Re: pip-sync

2023-07-24 Thread Lars Liedtke via Python-list
eate the venv with --system-site-packages (at least that's the commandline option for pip) I only saw behaviour like this so far, when my venv was with --system-site-packages and a package was installed by the system. Cheers Lars Am 21.07.23 um 20:08 schrieb Larry Martell via Python-list: I

Re: pip-sync

2023-07-24 Thread Lars Liedtke via Python-list
D | VAT ID: DE234663798 Informationen zum Datenschutz | Information about privacy policy https://www.solute.de/ger/datenschutz/grundsaetze-der-datenverarbeitung.php Am 21.07.23 um 20:08 schrieb Larry Martell via Python-list: I am trying to set up and maintain a venv with pip-sync. On my bare metal I h

Re: pip-sync

2023-07-24 Thread Larry Martell via Python-list
working as expected. -- https://mail.python.org/mailman/listinfo/python-list

Re: Meta Class Maybe?

2023-07-24 Thread Dom Grigonis via Python-list
> On 23 Jul 2023, at 02:12, Chris Nyland via Python-list > wrote: > > So I am stuck on a problem. I have a class which I want to use to create > another class without having to go through the boiler plate of subclassing. > Specifically because the subclass needs to

Odd types.get_original_bases() behavior for classes with generic bases but no type arguments

2023-07-24 Thread Chris Bouchard via Python-list
curses down a type's inheritance tree inspecting the original bases—I currently have to work around this behavior via hacks like checking "__orig_bases__" in cls.__dict__ or any(types.get_original_bases(cls) == types.get_original_bases(base) for base in cls.__bases__). (Unless I'm missing some simpler solution.) Is this something that could (should?) be addressed before 3.12 lands? Thanks, Chris Bouchard -- https://mail.python.org/mailman/listinfo/python-list

Re: Odd types.get_original_bases() behavior for classes with generic bases but no type arguments

2023-07-24 Thread Chris Bouchard via Python-list
Thanks, Chris Bouchard -- https://mail.python.org/mailman/listinfo/python-list

Fallback for operator and other dunder methods

2023-07-25 Thread Dom Grigonis via Python-list
erred evaluation— Dg -- https://mail.python.org/mailman/listinfo/python-list

Re: Fallback for operator and other dunder methods

2023-07-25 Thread Chris Angelico via Python-list
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 obje

Re: Fallback for operator and other dunder methods

2023-07-25 Thread Dom Grigonis via Python-list
Could you give an example? Something isn’t working for me. > On 26 Jul 2023, at 09:40, Chris Angelico via Python-list > wrote: > > On Wed, 26 Jul 2023 at 12:23, Dom Grigonis via Python-list > wrote: >> print(a + 1)# TypeError: unsupported operand type(s) fo

Re: Fallback for operator and other dunder methods

2023-07-26 Thread Chris Angelico via Python-list
want. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

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
ts) and frugal use of the meaning of what values can occur there. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list

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
ocs.python.org/3/c-api/frame.html?highlight=frame#c.PyFrameObject) > > of the virtual-machine - where typing is not a 'thing'. > > > It's an interesting question. Perhaps a better mind than mine can give a > better answer? > > Thank you DN. My ultimate goal is a func

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
-new-releases-9>We hope you enjoy the new releases! Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation <https://www.python.org/psf-landing/>. Your release team, Thomas Wouters Ned Deily Steve Dower Łukasz Langa -- Thomas Wouters -- https://mail.python.org/mailman/listinfo/python-list

Re: Where is the error?

2023-08-06 Thread Cameron Simpson via Python-list
g where you'd missing a semicolon. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list

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 < python-list@python.org> 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
person['name'] is $person['mood'] #end for Oleg. -- Oleg Broytman https://phdru.name/p...@phdru.name Programmers don't die, they just GOSUB without RETURN. -- https://mail.python.org/mailman/listinfo/python-list

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
.select(Person.q.lname=="Doe").count() >>> pc 1 Oleg. -- Oleg Broytmanhttps://phdru.name/p...@phdru.name Programmers don't die, they just GOSUB without RETURN. -- https://mail.python.org/mailman/listinfo/python-list

Imports and dot-notation

2023-08-09 Thread Oliver Schinagl via Python-list
the python community, it is generally preferred and a good idea to use dot-notation. But how correct are they lol. Thank you for reading, Olliver -- https://mail.python.org/mailman/listinfo/python-list

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: python-list@python.org Subject: Re: Planning a Python / PyData conferen

Re: Imports and dot-notation

2023-08-09 Thread Cameron Simpson via Python-list
ble. But in a very long piece of code with many imports you might go for module1.funcname for clarity, particularly if funcname is generic or overlaps with another similar imported name. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list

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
en – Deutsches Forschungszentrum für Gesundheit und Umwelt (GmbH) Ingolstädter Landstraße 1, D-85764 Neuherberg, https://www.helmholtz-munich.de Geschäftsführung: Prof. Dr. med. Dr. h.c. Matthias Tschöp, Daniela Sommer (komm.) | Aufsichtsratsvorsitzende: MinDir’in Prof. Dr. Veronika von Messling Registergericht: Amtsgericht München HRB 6466 | USt-IdNr. DE 129521671 -- https://mail.python.org/mailman/listinfo/python-list

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 esta...@hestates.org Get Outlook for iOS<https://aka.ms/o0ukef> From: Fulian Wang Sent: Wednesday, August 9, 2023 1:14:23 PM To: dn ; python-list@python.org 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 muenchen...@python.org> On Behalf Of Bernd Lentes via Python-list >Sent: Friday, August 11, 2023 12:01 PM >To: Terry Reedy >Cc: Python ML (python-list@python.org) >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
ion functionality to learn which attributes are made available by the binding's message class. -- https://mail.python.org/mailman/listinfo/python-list

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
is should give you the default translation. -- https://mail.python.org/mailman/listinfo/python-list

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
f: HRB 46611 https://www.egenix.com/company/contact/ https://www.malemburg.com/ -- https://mail.python.org/mailman/listinfo/python-list

divmod with negative Decimal values

2023-08-21 Thread Rob Cliffe via Python-list
60) (Decimal('-0'), Decimal('-1')) Best wishes Rob Cliffe -- https://mail.python.org/mailman/listinfo/python-list

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
discuss.python.org/u/pablogsal> Łukasz Langa @ambv <https://discuss.python.org/u/ambv> Thomas Wouters @thomas <https://discuss.python.org/u/thomas> signature.asc Description: Message signed with OpenPGP -- https://mail.python.org/mailman/listinfo/python-list

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
e value supplied to it. Would it be possible to have a different error message, something like ValueError: int expected in format string but decimal.Decimal found Or am I missing something? Best wishes Rob Cliffe -- https://mail.python.org/mailman/listinfo/python-list

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
_ in rev ) print( 'after sum():', [ x for x in rev ] ) which produces: $ python /tmp/rev orig ['x', 'a', 'y', 'b', 'z', 'c'] 6 before iteration: ['c', 'z', 'b', 'y', 'a', 'x'] after iteration: [] after sum(): [] Regards, Pierre -- https://mail.python.org/mailman/listinfo/python-list

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
you enjoy the new releases! Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation <https://www.python.org/psf-landing/>. Your release team, Thomas Wouters Ned Deily Steve Dower Łukasz Langa -- Thomas Wouters -- https://mail.python.org/mailman/listinfo/python-list

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
pip ... Skip > -- https://mail.python.org/mailman/listinfo/python-list

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
we must use one of the two, please explain the why, I really want to know, thanks! -- https://mail.python.org/mailman/listinfo/python-list

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

<    16   17   18   19   20   21   22   23   24   25   >