Commit Graph

11 Commits

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