cpython/Doc/whatsnew
Victor Stinner 3bb09947ec
bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag (GH-25721)
Add a new Py_TPFLAGS_DISALLOW_INSTANTIATION type flag to disallow
creating type instances: set tp_new to NULL and don't create the
"__new__" key in the type dictionary.

The flag is set automatically on static types if tp_base is NULL or
&PyBaseObject_Type and tp_new is NULL.

Use the flag on the following types:

* _curses.ncurses_version type
* _curses_panel.panel
* _tkinter.Tcl_Obj
* _tkinter.tkapp
* _tkinter.tktimertoken
* _xxsubinterpretersmodule.ChannelID
* sys.flags type
* sys.getwindowsversion() type
* sys.version_info type

Update MyStr example in the C API documentation to use
Py_TPFLAGS_DISALLOW_INSTANTIATION.

Add _PyStructSequence_InitType() function to create a structseq type
with the Py_TPFLAGS_DISALLOW_INSTANTIATION flag set.

type_new() calls _PyType_CheckConsistency() at exit.
2021-04-30 12:46:15 +02:00
..
2.0.rst bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174) 2018-12-19 08:09:46 +02:00
2.1.rst bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174) 2018-12-19 08:09:46 +02:00
2.2.rst bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174) 2018-12-19 08:09:46 +02:00
2.3.rst bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174) 2018-12-19 08:09:46 +02:00
2.4.rst bpo-33641: Convert RFC references into links. (GH-7103) 2018-05-31 07:39:00 +03:00
2.5.rst bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174) 2018-12-19 08:09:46 +02:00
2.6.rst Docs: FIX broken links. (GH-13491) 2019-05-25 20:02:24 +02:00
2.7.rst bpo-38600: NULL -> ``NULL``. (GH-17001) 2019-10-30 21:37:16 +02:00
3.0.rst bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174) 2018-12-19 08:09:46 +02:00
3.1.rst Fix miscellaneous typos (#4275) 2017-11-05 15:37:50 +02:00
3.2.rst Revert "Fix all Python Cookbook links (#22205)" (GH-22424) 2020-09-27 01:47:25 +01:00
3.3.rst bpo-40204, doc: Fix syntax of C variables (GH-21846) 2020-08-13 22:11:50 +02:00
3.4.rst bpo-38600: NULL -> ``NULL``. (GH-17001) 2019-10-30 21:37:16 +02:00
3.5.rst bpo-40204: Fix reference to terms in the doc (GH-21865) 2020-08-14 12:20:05 +02:00
3.6.rst bpo-43774: Document configure options (GH-25283) 2021-04-08 22:32:21 +02:00
3.7.rst bpo-43774: Document configure options (GH-25283) 2021-04-08 22:32:21 +02:00
3.8.rst bpo-43774: Enhance debug build documentation (GH-25712) 2021-04-29 13:06:59 +02:00
3.9.rst bpo-43908: Document Static Types in the C API (GH-25710) 2021-04-29 10:26:34 +02:00
3.10.rst bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag (GH-25721) 2021-04-30 12:46:15 +02:00
changelog.rst Include additional changes to support blurbified NEWS (#3340) 2017-09-05 00:46:18 -07:00
index.rst Python 3.10.0a0 (GH-20198) 2020-05-19 03:33:01 +01:00