Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions Doc/library/curses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,11 @@ The :mod:`curses` module defines the following data members:
:const:`OK` upon success.


.. data:: NCURSES_EXT_FUNCS

An integer object representing the current version of the ncurses extensions.


.. data:: version

A bytes object representing the current version of the module. Also available as
Expand Down
3 changes: 3 additions & 0 deletions Doc/whatsnew/3.9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ Add :func:`curses.get_escdelay`, :func:`curses.set_escdelay`,
:func:`curses.get_tabsize`, and :func:`curses.set_tabsize` functions.
(Contributed by Anthony Sottile in :issue:`38312`.)

Add :data:`~curses.NCURSES_EXT_FUNCS` constant.
(Contributed by Batuhan Taskaya in :issue:`40207`)

datetime
--------
The :meth:`~datetime.date.isocalendar()` of :class:`datetime.date`
Expand Down
10 changes: 6 additions & 4 deletions Lib/test/test_curses.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,12 @@ def test_module_funcs(self):
curses.putp(b'abc')
curses.qiflush()
curses.raw() ; curses.raw(1)
curses.set_escdelay(25)
self.assertEqual(curses.get_escdelay(), 25)
curses.set_tabsize(4)
self.assertEqual(curses.get_tabsize(), 4)
if getattr(curses, "set_escdelay"):
curses.set_escdelay(25)
self.assertEqual(curses.get_escdelay(), 25)
if getattr(curses, "set_tabsize"):
curses.set_tabsize(4)
self.assertEqual(curses.get_tabsize(), 4)
if hasattr(curses, 'setsyx'):
curses.setsyx(5,5)
curses.tigetflag('hc')
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.
3 changes: 3 additions & 0 deletions Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -4617,6 +4617,9 @@ PyInit__curses(void)
PyErr_Clear();
}
#endif /* NCURSES_VERSION */
#ifdef NCURSES_EXT_FUNCS
SetDictInt("NCURSES_EXT_FUNCS", NCURSES_EXT_FUNCS);
#endif

SetDictInt("ERR", ERR);
SetDictInt("OK", OK);
Expand Down