mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-26 22:01:14 +08:00
curses._ncurses_version updates (#13023)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import sys
|
||||
from _curses import *
|
||||
from _curses import window as window
|
||||
from _typeshed import structseq
|
||||
from collections.abc import Callable
|
||||
from typing import TypeVar
|
||||
from typing import Final, TypeVar, final, type_check_only
|
||||
from typing_extensions import Concatenate, ParamSpec
|
||||
|
||||
# NOTE: The _curses module is ordinarily only available on Unix, but the
|
||||
@@ -25,3 +27,19 @@ def wrapper(func: Callable[Concatenate[window, _P], _T], /, *arg: _P.args, **kwd
|
||||
# it was mapped to the name 'window' in 3.8.
|
||||
# Kept here as a legacy alias in case any third-party code is relying on it.
|
||||
_CursesWindow = window
|
||||
|
||||
# At runtime this class is unexposed and calls itself curses.ncurses_version.
|
||||
# That name would conflict with the actual curses.ncurses_version, which is
|
||||
# an instance of this class.
|
||||
@final
|
||||
@type_check_only
|
||||
class _ncurses_version(structseq[int], tuple[int, int, int]):
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = ("major", "minor", "patch")
|
||||
|
||||
@property
|
||||
def major(self) -> int: ...
|
||||
@property
|
||||
def minor(self) -> int: ...
|
||||
@property
|
||||
def patch(self) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user