Re: Drop into REPL when your program crashes.

2025-09-10 Thread Annada Behera via Python-list
So, ipdb is the ipython version of pdb. In fact, post_mortem is a pdb function. I use ipdb because its REPL is a bit nicer to work with then pdb. -Original Message- From: Stefan Ram Subject: Re: Drop into REPL when your program crashes. Date: 09/08/2025 06:04:16 PM Newsgroups: comp.lang.p

Re: Drop into REPL when your program crashes.

2025-09-10 Thread Ethan Carter
Annada Behera writes: > Hi, > > Recently I have been increasingly adding this piece of code as > a preamble to a lot of my code. > > import (sys, os, ipdb) > > def debug_hook(exc_type, exc_value, traceback): > if exc_type is KeyboardInterrupt: > sys.__excepthook__(exc_

Re: Test message. Posted a question several days ago and don't see it.

2025-09-10 Thread dn via Python-list
Hi Steve, ask away... On 11/09/25 16:15, Steve Jorgensen via Python-list wrote: I posted a question here several days ago and received a "Welcome to the "Python-list" mailing list!" email, but I still don't see my question in the list. I'm posting this mainly to see if it shows up, or I get a

Re: an adventure: a Lisp-style linked list

2025-09-10 Thread Ethan Carter
[email protected] (Pierre Asselin) writes: > Ethan Carter wrote: > >> def __init__(self, d, ls): >> self.head = d >> self.tail = ls > > Why not > def __init__(self, d, ls=None): > > and avoid the need for a List.Empty ? Thanks! That's a good suggestion. -- https://mail.pyt

staticmethod(cls)

2025-09-10 Thread Pierre Asselin
For reasons I won't go into I ended up defining classes inside of a class body. That's not in the manual, but I see no reason it would fail. But then, I accidentally decorated the inner classes with @staticmethod! It didn't break anything, but it had an interesting side effect: help() and pydoc on

Test message. Posted a question several days ago and don't see it.

2025-09-10 Thread Steve Jorgensen via Python-list
I posted a question here several days ago and received a "Welcome to the "Python-list" mailing list!" email, but I still don't see my question in the list. I'm posting this mainly to see if it shows up, or I get a reply from a moderator, or something like that. -- https://mail.python.org/mailm

Re: an adventure: a Lisp-style linked list

2025-09-10 Thread Pierre Asselin
Ethan Carter wrote: > def __init__(self, d, ls): > self.head = d > self.tail = ls Why not def __init__(self, d, ls=None): and avoid the need for a List.Empty ? -- pa at panix dot com -- https://mail.python.org/mailman3//lists/python-list.python.org

Detailed documentation or specs for behavior of descriptors in attributes of metaclasses

2025-09-10 Thread Steve Jorgensen via Python-list
I've been experimenting to deepen my understanding of Python's behavior in regard to metaclasses, descriptors, and other meta-programming stuff. In the process, I have come across a behavior that is presumably by design but cannot be inferred from anything I can find in the official documentatio

Drop into REPL when your program crashes.

2025-09-10 Thread Annada Behera via Python-list
Hi, Recently I have been increasingly adding this piece of code as a preamble to a lot of my code. import (sys, os, ipdb) def debug_hook(exc_type, exc_value, traceback): if exc_type is KeyboardInterrupt: sys.__excepthook__(exc_type, exc_value, traceback) r