Commit Graph

37 Commits

Author SHA1 Message Date
Konstantin Baikov d69a864a88 Use SupportsWrite in curses instead of IO Any (#13325)
The source used to deduce  this: https://github.com/python/cpython/blob/aea2e03b276c79f8934d17056a68899e69763fae/Modules/_cursesmodule.c#L2158
2024-12-29 17:12:42 -08:00
Stephen Morton 405b1bdb2f curses._ncurses_version updates (#13023)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-11-16 23:16:34 +00:00
Stephen Morton f318894924 update _CursesWindow to the runtime name "window" (#12744)
Prior to 3.8 the underlying C class was not given a name in
python, so typeshed added _CursesWindow to use it as a type.
Now that it has a name in python, typeshed should use that name.

We can keep _CursesWindow as an alias, for anyone using that
already.
2024-10-06 19:04:55 -07:00
Vito De Tullio 4507d26ef2 curses: mark keypad yes parameter as positional only (#12605)
matches the runtime check: "TypeError: window.keypad() takes no keyword arguments"
2024-09-01 20:20:31 +03:00
sobolevn 1a8c7ebe37 HAVE_NCURSESW is present on macos (#12441) 2024-07-27 10:36:08 +02:00
Alex Waygood 3ab03deec3 Upgrade to latest 3.12 and 3.13 versions for stubtest (#12131) 2024-06-12 05:16:39 -06:00
Ryan McCampbell 5e2f741209 Remove Windows checks from curses (#11241)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2024-04-06 17:12:48 +03:00
Shantanu 470a13ab09 Use PEP 570 syntax in stdlib (#11250) 2024-03-09 14:50:16 -08:00
Alex Waygood c49c84f319 A new shade of Black (#11362) 2024-02-04 16:38:55 -08:00
Sebastian Rittau 53a8193d64 Update typing_extensions imports in stdlib (#11244)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2024-01-05 08:15:19 -08:00
Sebastian Rittau 23604858a6 Remove Python 3.7 branches (#11238) 2024-01-05 11:39:39 +01:00
Alex Waygood e4edcf23e0 Fix platform availability of some Unix constants (#10857) 2023-10-07 15:05:20 -07:00
Nikita Sobolev 460fa14dfc Fix curses.color_pair signature (#10811)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-09-30 20:58:37 +01:00
Nikita Sobolev 4c5d3e5ad2 Some curses functions were removed in 3.12 for macos (#10808) 2023-09-30 11:28:09 +02:00
Jelle Zijlstra 0fc3a567fc stdlib: add defaults for modules accessible on MacOS (#9659)
Ran stubdefaulter with standard options on a Mac.
2023-02-01 22:46:55 +00:00
Jelle Zijlstra ddfaca3200 stdlib: add argument default values (#9501) 2023-01-18 09:37:34 +01:00
Jelle Zijlstra e0aa539854 _curses: improve bytes handling (#9007) 2022-10-27 19:48:08 -07:00
Alex Waygood edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Alex Waygood fbddd2c4e2 stdlib: enforce CamelCase for type alias names (#8255) 2022-07-07 17:45:23 +02:00
Alex Waygood 740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Alex Waygood 3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Shantanu a6d9b83263 Add @final to several more stdlib classes (#7215)
Co-authored-by: hauntsaninja <>
2022-02-14 15:12:40 -08:00
Shantanu b88a6f19cd Upgrade black version (#7089) 2022-01-30 16:27:06 -08:00
Alex Waygood 048f4fe720 curses is not available on Windows (#6749) 2021-12-29 21:29:13 +01:00
Jelle Zijlstra 183a43a7e0 Fixes to curses stubs (#6620) 2021-12-17 18:39:00 +01:00
Rohan 45e39edb22 curses: getstr(), inch() and instr() no longer return union type (#6409) 2021-11-28 12:34:11 +02:00
Akuli 994b69ef8f Use lowercase tuple where possible (#6170) 2021-10-14 17:18:19 -07:00
Jeremy Nation 0e62c8ab06 Add missing stub for _CursesWindow.noutrefresh (#5928) 2021-08-14 23:55:43 +02:00
Akuli ee487304d7 Big diff: Use new "|" union syntax (#5872) 2021-08-08 11:05:21 +02:00
Pavel Karateev ee4d9fb106 Expose curses.BUTTON5_* in Python 3.10 (#5556)
* Expose curses.BUTTON5_* in Python 3.10

* curses.BUTTON5_* aren't available on macOS
2021-05-30 16:58:31 +03:00
Pavel Karateev 33ea648988 Add curses.has_extended_color_support() for Python 3.10 (#5549) 2021-05-28 18:50:36 +02:00
Akuli 17dcea4a68 Akuli and srittau: Remove Python 2 branches from Python 3 stubs (#5461)
* run script and do some manual changes (Akuli)

* do the whole thing manually (srittau)

* merge changes (Akuli)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-05-15 15:33:39 +03:00
Shantanu d36420146e _curses: fix positional-only args (#5279) 2021-05-02 00:34:20 +02:00
Ryan McCampbell 701e741946 Rename _CursesWindow to window (#5180)
* Rename _CursesWindow to window in Python >= 3.8

The name _CursesWindow is not exposed at runtime which makes explicit type annotation difficult. It has to be wrapped in quotes, and this doesn't seem to work for all type checkers: PyLance's typechecker accepts it but Jedi's doesn't (tested in VS Code). This is especially annoying because with curses.wrapper(callback) there is no way to infer the type of the passed window except with an explicit annotation.
Experimentally, the type is exposed under the name "_curses.window" in Python 3.9 on both Ubuntu and Windows (via [windows-curses](https://pypi.org/project/windows-curses/)). While this is not explicitly documented as public, it is the name used for all the window method docs, and it is probably unlikely to change since some might interpret the lack of underscore as indicating it is public. Unfortunately it doesn't seem to be exposed as such in Python 2, but `¯\_(ツ)_/¯`. Using the runtime name should allow type checking to work with most typecheckers/platforms without quotes, and the old name can be kept as an alias for backwards compatibility.

I discovered the name _curses.window is only actually exported in Python >= 3.8 so I moved the name behind a version check, and reverted the original class name to _CursesWindow

Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-04-05 23:59:37 +03:00
hatal175 3de5d893de Add Curses ACS Codes (#5116)
Closes: #5115
2021-03-15 15:24:32 +01:00
Sebastian Rittau 2b19c761ec Fix build (#5086)
Run the mypy test suite using Ubuntu 18.04. Ubuntu 20.04 doesn't have a package for virtualenv on Python 2.

Also, curses.color_pair() now has a named argument.
2021-03-04 17:11:37 +01:00
Ivan Levkivskyi 16ae4c6120 Re-organize directory structure (#4971)
See discussion in #2491

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-27 12:00:39 +00:00