This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2013年02月11日 22:35 by cjw296, last changed 2022年04月11日 14:57 by admin.
| Messages (8) | |||
|---|---|---|---|
| msg181935 - (view) | Author: Chris Withers (cjw296) * (Python committer) | Date: 2013年02月11日 22:35 | |
Python 2 had a private but usable way of introspecting and manipulating registered atexit handlers by way of the atexit._exithandlers. In Python 3, registering and unregistering are handled, but there is no longer a way to see what atexit handlers are registered. Barry suggested filing a bug to have this added as a new feature for Python 3.4. Some kind of read-only sequence would be fine, if the original list can no longer be exposed. |
|||
| msg182683 - (view) | Author: Charles-François Natali (neologix) * (Python committer) | Date: 2013年02月22日 18:49 | |
Could you please give an example of why this would be a useful addition? I can see the usage of removing a handler, but the user should know which handlers are registered. |
|||
| msg182684 - (view) | Author: Chris Withers (cjw296) * (Python committer) | Date: 2013年02月22日 18:51 | |
Barry advised me to open this issue as it's a functional regression from Python 2. My use case is unit testing code that registers atexit handlers and making sure the right handlers are registered with the correct parameters. |
|||
| msg182685 - (view) | Author: Charles-François Natali (neologix) * (Python committer) | Date: 2013年02月22日 18:54 | |
> Barry advised me to open this issue as it's a functional regression from Python 2. But it was relying on a private and non documented feature in Python 2, so it's not really a regression. > My use case is unit testing code that registers atexit handlers and making sure the right handlers are registered with the correct parameters. IMO, complicating an API for testing purpose is a bad idea. |
|||
| msg182686 - (view) | Author: Chris Withers (cjw296) * (Python committer) | Date: 2013年02月22日 18:55 | |
I can think of other use cases. Anyway, I'm just glad your opinion isn't the only one there is ;-) |
|||
| msg182688 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年02月22日 19:08 | |
I don't think you want your test suite to run your atexit handlers at exit, so you should probably mock atexit.register instead. |
|||
| msg182692 - (view) | Author: Barry A. Warsaw (barry) * (Python committer) | Date: 2013年02月22日 19:41 | |
On Feb 22, 2013, at 06:54 PM, Charles-François Natali wrote: >Charles-François Natali added the comment: > >> Barry advised me to open this issue as it's a functional regression from >> Python 2. > >But it was relying on a private and non documented feature in Python >2, so it's not really a regression. I also suggested it would have to be considered a new feature for 3.4. |
|||
| msg396594 - (view) | Author: Irit Katriel (iritkatriel) * (Python committer) | Date: 2021年06月27日 18:47 | |
See also issue32082. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:41 | admin | set | github: 61388 |
| 2021年11月30日 16:59:52 | iritkatriel | set | type: enhancement components: + Library (Lib) versions: + Python 3.11, - Python 3.4 |
| 2021年11月24日 12:04:44 | iritkatriel | link | issue32082 superseder |
| 2021年06月27日 18:47:23 | iritkatriel | set | nosy:
+ iritkatriel messages: + msg396594 |
| 2013年02月22日 19:41:54 | barry | set | messages: + msg182692 |
| 2013年02月22日 19:08:08 | pitrou | set | nosy:
+ pitrou messages: + msg182688 |
| 2013年02月22日 18:55:26 | cjw296 | set | messages: + msg182686 |
| 2013年02月22日 18:54:20 | neologix | set | messages: + msg182685 |
| 2013年02月22日 18:51:28 | cjw296 | set | messages: + msg182684 |
| 2013年02月22日 18:49:20 | neologix | set | nosy:
+ neologix messages: + msg182683 |
| 2013年02月20日 22:20:43 | barry | set | nosy:
+ barry |
| 2013年02月11日 22:35:30 | cjw296 | create | |