Commit Graph

21 Commits

Author SHA1 Message Date
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