cpython/Misc
Guido van Rossum 602630ac18
bpo-46752: Add TaskGroup; add Task..cancelled(),.uncancel() (GH-31270)
asyncio/taskgroups.py is an adaptation of taskgroup.py from EdgeDb, with the following key changes:

- Allow creating new tasks as long as the last task hasn't finished
- Raise [Base]ExceptionGroup (directly) rather than TaskGroupError deriving from MultiError
- Instead of monkey-patching the parent task's cancel() method,
  add a new public API to Task

The Task class has a new internal flag, `_cancel_requested`, which is set when `.cancel()` is called successfully. The `.cancelling()` method returns the value of this flag. Further `.cancel()` calls while this flag is set return False. To reset this flag, call `.uncancel()`.

Thus, a Task that catches and ignores `CancelledError` should call `.uncancel()` if it wants to be cancellable again; until it does so, it is deemed to be busy with uninterruptible cleanup.

This new Task API helps solve the problem where TaskGroup needs to distinguish between whether the parent task being cancelled "from the outside" vs. "from inside".

Co-authored-by: Yury Selivanov <yury@edgedb.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-02-15 15:42:04 -08:00
..
NEWS.d bpo-46752: Add TaskGroup; add Task..cancelled(),.uncancel() (GH-31270) 2022-02-15 15:42:04 -08:00
ACKS bpo-46407: Optimizing some modulo operations (GH-30653) 2022-01-27 18:46:45 -06:00
coverity_model.c
gdbinit gdbinit: Use proper define syntax (GH-19557) 2020-04-23 05:49:26 -07:00
HISTORY Fixed typos (GH-29211) 2021-10-28 21:39:27 +02:00
indent.pro
Porting
python-config.in bpo-38468 : Refactor python-config (#16749) 2019-10-15 11:18:47 -03:00
python-config.sh.in
python-embed.pc.in
python.man bpo-44584: Deprecate PYTHONTHREADDEBUG env var (GH-27065) 2021-08-06 13:11:12 +02:00
python.pc.in
README bpo-23469: Delete Wing IDE configuration files (GH-30067) 2021-12-14 15:01:13 +02:00
README.AIX bpo-42087: Remove support for AIX 5.3 and below (GH-22830) 2020-11-16 16:16:10 +01:00
README.coverity
README.valgrind closes docs: remove references to Py_USING_MEMORY_DEBUGGER (GH-30284) 2021-12-29 16:20:42 -06:00
requirements-test.txt Update tzdata to 2020.3 (GH-22856) 2020-10-21 06:40:43 -07:00
SpecialBuilds.txt bpo-43774: Remove unused PYMALLOC_DEBUG macro (GH-25711) 2021-04-29 10:47:47 +02:00
stable_abi.txt bpo-45459: Add Py_buffer to limited API (GH-29991) 2022-02-02 07:03:10 -08:00
svnmap.txt
valgrind-python.supp bpo-35561: Supress valgrind false alarm on epoll_ctl(event) (GH-18060) 2020-01-19 23:38:37 +01:00
vgrindefs

Python Misc subdirectory
========================

This directory contains files that wouldn't fit in elsewhere.  Some
documents are only of historic importance.

Files found here
----------------

ACKS                    Acknowledgements
gdbinit                 Handy stuff to put in your .gdbinit file, if you use gdb
HISTORY                 News from previous releases -- oldest last
indent.pro              GNU indent profile approximating my C style
NEWS                    News for this release (for some meaning of "this")
Porting                 Mini-FAQ on porting to new platforms
python-config.in        Python script template for python-config
python.man              UNIX man page for the python interpreter
python.pc.in            Package configuration info template for pkg-config
README                  The file you're reading now
README.AIX              Information about using Python on AIX
README.coverity         Information about running Coverity's Prevent on Python
README.valgrind         Information for Valgrind users, see valgrind-python.supp
SpecialBuilds.txt       Describes extra symbols you can set for debug builds
svnmap.txt              Map of old SVN revs and branches to hg changeset ids,
                        help history-digging
valgrind-python.supp    Valgrind suppression file, see README.valgrind
vgrindefs               Python configuration for vgrind (a generic pretty printer)