Skip to content

gh-84388: Expose NCURSES_EXT_FUNCS #19392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Doc/library/curses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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__

Expand Down
6 changes: 6 additions & 0 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Expose ``NCURSES_EXT_FUNCS`` under :mod:`curses`. Patch by Batuhan Taskaya.
4 changes: 4 additions & 0 deletions Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's a conditional constant, we should probably say that it's conditional in the docs, shouldn't we?

#endif
#undef SetDictInt
return 0;
}
Expand Down
Loading