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

Conversation

isidentical
Copy link
Member

@isidentical isidentical commented Apr 6, 2020

@isidentical
Copy link
Member Author

@serhiy-storchaka the tests from set_escdelay/set_tabsize (and get-s) are failing under some platforms due to their inexistance. Could you review this PR?

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Would not be more reliable to use hasattr(curses, 'set_escdelay')? AFAIK set_escdelay and set_tabsize are supported in the NetBSD curses, so we may add their support with non-ncurses implementations.

@isidentical
Copy link
Member Author

@serhiy-storchaka do you have a source for me that when was they introduced (or was they always available)? Because for the current implementation, we only support ncurses.

#if defined(NCURSES_EXT_FUNCS) && NCURSES_EXT_FUNCS >= 20081102

@isidentical
Copy link
Member Author

After digging through the internet, I couldn't find any relevant information about this (when was they introduced, how can I check their existance or not etc). We might want to go with a config variable (like HAVE_CURSES_TABSIZE etc. but looks like it is a bit overkill. I'll change the tests according to a getatr call, but I dont want to introduce netbsd support on this PR (because I have literally no information about that system). It might be an open issue, but for this PR's concern, it only exposes NCURSES_EXT_FUNCS and manages tests to run when they needed.

@furkanonder
Copy link
Contributor

@isidentical Could you resolve the conflict?

@ghost
Copy link

ghost commented Dec 1, 2023

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:
CLA not signed

@erlend-aasland erlend-aasland changed the title bpo-40207: Expose NCURSES_EXT_FUNCS gh-84388: Expose NCURSES_EXT_FUNCS Dec 30, 2024
@@ -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?

@serhiy-storchaka
Copy link
Member

I have doubts that this will be useful.

  • The hasattr() check is more reliable.
  • If you need the NCURSES_EXT_FUNCS value, it is already available as ncurses_version().patch.
  • It's value is not enough, as the behavior depends also on other macros, like NCURSES_EXT_COLORS and HAVE_NCURSESW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants