diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst index 6c7fc721a3e0fb..4fe2d5b1e1cb9a 100644 --- a/Doc/library/curses.rst +++ b/Doc/library/curses.rst @@ -1325,6 +1325,13 @@ The :mod:`curses` module defines the following data members: :const:`OK` upon success. +.. data:: NCURSES_EXT_FUNCS + + An integer representing the current version of the ncurses extensions. + + .. versionadded:: next + + .. data:: version .. data:: __version__ diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 63fa21e17bc834..88a3f110dbba22 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -326,6 +326,12 @@ ctypes * On Windows, the :func:`~ctypes.CopyComPointer` function is now public. (Contributed by Jun Komoda in :gh:`127275`.) +curses +------ + +* Add :data:`~curses.NCURSES_EXT_FUNCS` constant. + (Contributed by Batuhan Taskaya in :gh:`84388`) + datetime -------- diff --git a/Misc/NEWS.d/next/Library/2020-04-06-18-56-16.bpo-40207.VWhrYL.rst b/Misc/NEWS.d/next/Library/2020-04-06-18-56-16.bpo-40207.VWhrYL.rst new file mode 100644 index 00000000000000..36ade741d8e80b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-06-18-56-16.bpo-40207.VWhrYL.rst @@ -0,0 +1 @@ +Expose ``NCURSES_EXT_FUNCS`` under :mod:`curses`. Patch by Batuhan Taskaya. diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 040ffa81153ebe..dd33e88329c2b7 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -5219,6 +5219,10 @@ cursesmodule_exec(PyObject *module) } SetDictInt("KEY_MIN", KEY_MIN); SetDictInt("KEY_MAX", KEY_MAX); + +#ifdef NCURSES_EXT_FUNCS + SetDictInt("NCURSES_EXT_FUNCS", NCURSES_EXT_FUNCS); +#endif #undef SetDictInt return 0; }