basedpyright 1.12.6 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pyright-langserver.js +1 -1
- package/dist/pyright-langserver.js.map +1 -1
- package/dist/pyright.js +1 -1
- package/dist/pyright.js.map +1 -1
- package/dist/typeshed-fallback/stdlib/_ast.pyi +279 -42
- package/dist/typeshed-fallback/stdlib/_bisect.pyi +149 -12
- package/dist/typeshed-fallback/stdlib/_codecs.pyi +125 -14
- package/dist/typeshed-fallback/stdlib/_csv.pyi +130 -7
- package/dist/typeshed-fallback/stdlib/_ctypes.pyi +72 -17
- package/dist/typeshed-fallback/stdlib/_curses.pyi +626 -78
- package/dist/typeshed-fallback/stdlib/_decimal.pyi +775 -153
- package/dist/typeshed-fallback/stdlib/_heapq.pyi +61 -5
- package/dist/typeshed-fallback/stdlib/_imp.pyi +70 -15
- package/dist/typeshed-fallback/stdlib/_json.pyi +55 -12
- package/dist/typeshed-fallback/stdlib/_locale.pyi +63 -12
- package/dist/typeshed-fallback/stdlib/_lsprof.pyi +61 -4
- package/dist/typeshed-fallback/stdlib/_operator.pyi +238 -62
- package/dist/typeshed-fallback/stdlib/_posixsubprocess.pyi +25 -1
- package/dist/typeshed-fallback/stdlib/_random.pyi +23 -5
- package/dist/typeshed-fallback/stdlib/_socket.pyi +618 -63
- package/dist/typeshed-fallback/stdlib/_stat.pyi +140 -13
- package/dist/typeshed-fallback/stdlib/_thread.pyi +215 -22
- package/dist/typeshed-fallback/stdlib/_tkinter.pyi +44 -11
- package/dist/typeshed-fallback/stdlib/_tracemalloc.pyi +71 -10
- package/dist/typeshed-fallback/stdlib/_warnings.pyi +53 -6
- package/dist/typeshed-fallback/stdlib/_weakref.pyi +43 -10
- package/dist/typeshed-fallback/stdlib/_winapi.pyi +255 -255
- package/dist/typeshed-fallback/stdlib/array.pyi +233 -44
- package/dist/typeshed-fallback/stdlib/atexit.pyi +50 -5
- package/dist/typeshed-fallback/stdlib/audioop.pyi +78 -26
- package/dist/typeshed-fallback/stdlib/binascii.pyi +105 -18
- package/dist/typeshed-fallback/stdlib/builtins.pyi +5254 -829
- package/dist/typeshed-fallback/stdlib/cmath.pyi +99 -23
- package/dist/typeshed-fallback/stdlib/errno.pyi +15 -0
- package/dist/typeshed-fallback/stdlib/faulthandler.pyi +33 -8
- package/dist/typeshed-fallback/stdlib/fcntl.pyi +199 -8
- package/dist/typeshed-fallback/stdlib/gc.pyi +130 -18
- package/dist/typeshed-fallback/stdlib/grp.pyi +58 -7
- package/dist/typeshed-fallback/stdlib/itertools.pyi +281 -42
- package/dist/typeshed-fallback/stdlib/marshal.pyi +82 -4
- package/dist/typeshed-fallback/stdlib/math.pyi +357 -61
- package/dist/typeshed-fallback/stdlib/mmap.pyi +47 -8
- package/dist/typeshed-fallback/stdlib/msvcrt.pyi +32 -32
- package/dist/typeshed-fallback/stdlib/nt.pyi +118 -111
- package/dist/typeshed-fallback/stdlib/parser.pyi +55 -24
- package/dist/typeshed-fallback/stdlib/posix.pyi +7 -0
- package/dist/typeshed-fallback/stdlib/pwd.pyi +60 -10
- package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +61 -12
- package/dist/typeshed-fallback/stdlib/readline.pyi +184 -27
- package/dist/typeshed-fallback/stdlib/resource.pyi +56 -16
- package/dist/typeshed-fallback/stdlib/select.pyi +97 -5
- package/dist/typeshed-fallback/stdlib/spwd.pyi +60 -11
- package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +386 -48
- package/dist/typeshed-fallback/stdlib/syslog.pyi +27 -7
- package/dist/typeshed-fallback/stdlib/termios.pyi +88 -8
- package/dist/typeshed-fallback/stdlib/time.pyi +314 -37
- package/dist/typeshed-fallback/stdlib/unicodedata.pyi +264 -34
- package/dist/typeshed-fallback/stdlib/winreg.pyi +172 -132
- package/dist/typeshed-fallback/stdlib/zlib.pyi +108 -7
- package/package.json +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"""Importing this module enables command line editing using libedit readline."""
|
|
2
|
+
|
|
1
3
|
import sys
|
|
2
4
|
from _typeshed import StrOrBytesPath
|
|
3
5
|
from collections.abc import Callable, Sequence
|
|
@@ -7,30 +9,185 @@ if sys.platform != "win32":
|
|
|
7
9
|
_Completer: TypeAlias = Callable[[str, int], str | None]
|
|
8
10
|
_CompDisp: TypeAlias = Callable[[str, Sequence[str], int], None]
|
|
9
11
|
|
|
10
|
-
def parse_and_bind(string: str, /) -> None:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def
|
|
36
|
-
|
|
12
|
+
def parse_and_bind(string: str, /) -> None:
|
|
13
|
+
"""
|
|
14
|
+
parse_and_bind(string) -> None
|
|
15
|
+
Execute the init line provided in the string argument.
|
|
16
|
+
"""
|
|
17
|
+
...
|
|
18
|
+
def read_init_file(filename: StrOrBytesPath | None = None, /) -> None:
|
|
19
|
+
"""
|
|
20
|
+
read_init_file([filename]) -> None
|
|
21
|
+
Execute a readline initialization file.
|
|
22
|
+
The default filename is the last filename used.
|
|
23
|
+
"""
|
|
24
|
+
...
|
|
25
|
+
def get_line_buffer() -> str:
|
|
26
|
+
"""
|
|
27
|
+
get_line_buffer() -> string
|
|
28
|
+
return the current contents of the line buffer.
|
|
29
|
+
"""
|
|
30
|
+
...
|
|
31
|
+
def insert_text(string: str, /) -> None:
|
|
32
|
+
"""
|
|
33
|
+
insert_text(string) -> None
|
|
34
|
+
Insert text into the line buffer at the cursor position.
|
|
35
|
+
"""
|
|
36
|
+
...
|
|
37
|
+
def redisplay() -> None:
|
|
38
|
+
"""
|
|
39
|
+
redisplay() -> None
|
|
40
|
+
Change what's displayed on the screen to reflect the current
|
|
41
|
+
contents of the line buffer.
|
|
42
|
+
"""
|
|
43
|
+
...
|
|
44
|
+
def read_history_file(filename: StrOrBytesPath | None = None, /) -> None:
|
|
45
|
+
"""
|
|
46
|
+
read_history_file([filename]) -> None
|
|
47
|
+
Load a readline history file.
|
|
48
|
+
The default filename is ~/.history.
|
|
49
|
+
"""
|
|
50
|
+
...
|
|
51
|
+
def write_history_file(filename: StrOrBytesPath | None = None, /) -> None:
|
|
52
|
+
"""
|
|
53
|
+
write_history_file([filename]) -> None
|
|
54
|
+
Save a readline history file.
|
|
55
|
+
The default filename is ~/.history.
|
|
56
|
+
"""
|
|
57
|
+
...
|
|
58
|
+
def append_history_file(nelements: int, filename: StrOrBytesPath | None = None, /) -> None:
|
|
59
|
+
"""
|
|
60
|
+
Append the last nelements items of the history list to file.
|
|
61
|
+
|
|
62
|
+
The default filename is ~/.history.
|
|
63
|
+
"""
|
|
64
|
+
...
|
|
65
|
+
def get_history_length() -> int:
|
|
66
|
+
"""
|
|
67
|
+
get_history_length() -> int
|
|
68
|
+
return the maximum number of lines that will be written to
|
|
69
|
+
the history file.
|
|
70
|
+
"""
|
|
71
|
+
...
|
|
72
|
+
def set_history_length(length: int, /) -> None:
|
|
73
|
+
"""
|
|
74
|
+
set_history_length(length) -> None
|
|
75
|
+
set the maximal number of lines which will be written to
|
|
76
|
+
the history file. A negative length is used to inhibit
|
|
77
|
+
history truncation.
|
|
78
|
+
"""
|
|
79
|
+
...
|
|
80
|
+
def clear_history() -> None:
|
|
81
|
+
"""
|
|
82
|
+
clear_history() -> None
|
|
83
|
+
Clear the current readline history.
|
|
84
|
+
"""
|
|
85
|
+
...
|
|
86
|
+
def get_current_history_length() -> int:
|
|
87
|
+
"""
|
|
88
|
+
get_current_history_length() -> integer
|
|
89
|
+
return the current (not the maximum) length of history.
|
|
90
|
+
"""
|
|
91
|
+
...
|
|
92
|
+
def get_history_item(index: int, /) -> str:
|
|
93
|
+
"""
|
|
94
|
+
get_history_item() -> string
|
|
95
|
+
return the current contents of history item at index.
|
|
96
|
+
"""
|
|
97
|
+
...
|
|
98
|
+
def remove_history_item(pos: int, /) -> None:
|
|
99
|
+
"""
|
|
100
|
+
remove_history_item(pos) -> None
|
|
101
|
+
remove history item given by its position
|
|
102
|
+
"""
|
|
103
|
+
...
|
|
104
|
+
def replace_history_item(pos: int, line: str, /) -> None:
|
|
105
|
+
"""
|
|
106
|
+
replace_history_item(pos, line) -> None
|
|
107
|
+
replaces history item given by its position with contents of line
|
|
108
|
+
"""
|
|
109
|
+
...
|
|
110
|
+
def add_history(string: str, /) -> None:
|
|
111
|
+
"""
|
|
112
|
+
add_history(string) -> None
|
|
113
|
+
add an item to the history buffer
|
|
114
|
+
"""
|
|
115
|
+
...
|
|
116
|
+
def set_auto_history(enabled: bool, /) -> None:
|
|
117
|
+
"""
|
|
118
|
+
set_auto_history(enabled) -> None
|
|
119
|
+
Enables or disables automatic history.
|
|
120
|
+
"""
|
|
121
|
+
...
|
|
122
|
+
def set_startup_hook(function: Callable[[], object] | None = None, /) -> None:
|
|
123
|
+
"""
|
|
124
|
+
set_startup_hook([function]) -> None
|
|
125
|
+
Set or remove the function invoked by the rl_startup_hook callback.
|
|
126
|
+
The function is called with no arguments just
|
|
127
|
+
before readline prints the first prompt.
|
|
128
|
+
"""
|
|
129
|
+
...
|
|
130
|
+
def set_pre_input_hook(function: Callable[[], object] | None = None, /) -> None:
|
|
131
|
+
"""
|
|
132
|
+
Set or remove the function invoked by the rl_pre_input_hook callback.
|
|
133
|
+
|
|
134
|
+
The function is called with no arguments after the first prompt
|
|
135
|
+
has been printed and just before readline starts reading input
|
|
136
|
+
characters.
|
|
137
|
+
"""
|
|
138
|
+
...
|
|
139
|
+
def set_completer(function: _Completer | None = None, /) -> None:
|
|
140
|
+
"""
|
|
141
|
+
set_completer([function]) -> None
|
|
142
|
+
Set or remove the completer function.
|
|
143
|
+
The function is called as function(text, state),
|
|
144
|
+
for state in 0, 1, 2, ..., until it returns a non-string.
|
|
145
|
+
It should return the next possible completion starting with 'text'.
|
|
146
|
+
"""
|
|
147
|
+
...
|
|
148
|
+
def get_completer() -> _Completer | None:
|
|
149
|
+
"""
|
|
150
|
+
get_completer() -> function
|
|
151
|
+
|
|
152
|
+
Returns current completer function.
|
|
153
|
+
"""
|
|
154
|
+
...
|
|
155
|
+
def get_completion_type() -> int:
|
|
156
|
+
"""
|
|
157
|
+
get_completion_type() -> int
|
|
158
|
+
Get the type of completion being attempted.
|
|
159
|
+
"""
|
|
160
|
+
...
|
|
161
|
+
def get_begidx() -> int:
|
|
162
|
+
"""
|
|
163
|
+
get_begidx() -> int
|
|
164
|
+
get the beginning index of the completion scope
|
|
165
|
+
"""
|
|
166
|
+
...
|
|
167
|
+
def get_endidx() -> int:
|
|
168
|
+
"""
|
|
169
|
+
get_endidx() -> int
|
|
170
|
+
get the ending index of the completion scope
|
|
171
|
+
"""
|
|
172
|
+
...
|
|
173
|
+
def set_completer_delims(string: str, /) -> None:
|
|
174
|
+
"""
|
|
175
|
+
set_completer_delims(string) -> None
|
|
176
|
+
set the word delimiters for completion
|
|
177
|
+
"""
|
|
178
|
+
...
|
|
179
|
+
def get_completer_delims() -> str:
|
|
180
|
+
"""
|
|
181
|
+
get_completer_delims() -> string
|
|
182
|
+
get the word delimiters for completion
|
|
183
|
+
"""
|
|
184
|
+
...
|
|
185
|
+
def set_completion_display_matches_hook(function: _CompDisp | None = None, /) -> None:
|
|
186
|
+
"""
|
|
187
|
+
set_completion_display_matches_hook([function]) -> None
|
|
188
|
+
Set or remove the completion display function.
|
|
189
|
+
The function is called as
|
|
190
|
+
function(substitution, [matches], longest_match_length)
|
|
191
|
+
once each time matches need to be displayed.
|
|
192
|
+
"""
|
|
193
|
+
...
|
|
@@ -29,6 +29,14 @@ if sys.platform != "win32":
|
|
|
29
29
|
class struct_rusage(
|
|
30
30
|
structseq[float], tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int]
|
|
31
31
|
):
|
|
32
|
+
"""
|
|
33
|
+
struct_rusage: Result from getrusage.
|
|
34
|
+
|
|
35
|
+
This object may be accessed either as a tuple of
|
|
36
|
+
(utime,stime,maxrss,ixrss,idrss,isrss,minflt,majflt,
|
|
37
|
+
nswap,inblock,oublock,msgsnd,msgrcv,nsignals,nvcsw,nivcsw)
|
|
38
|
+
or via the attributes ru_utime, ru_stime, ru_maxrss, and so on.
|
|
39
|
+
"""
|
|
32
40
|
if sys.version_info >= (3, 10):
|
|
33
41
|
__match_args__: Final = (
|
|
34
42
|
"ru_utime",
|
|
@@ -50,37 +58,69 @@ if sys.platform != "win32":
|
|
|
50
58
|
)
|
|
51
59
|
|
|
52
60
|
@property
|
|
53
|
-
def ru_utime(self) -> float:
|
|
61
|
+
def ru_utime(self) -> float:
|
|
62
|
+
"""user time used"""
|
|
63
|
+
...
|
|
54
64
|
@property
|
|
55
|
-
def ru_stime(self) -> float:
|
|
65
|
+
def ru_stime(self) -> float:
|
|
66
|
+
"""system time used"""
|
|
67
|
+
...
|
|
56
68
|
@property
|
|
57
|
-
def ru_maxrss(self) -> int:
|
|
69
|
+
def ru_maxrss(self) -> int:
|
|
70
|
+
"""max. resident set size"""
|
|
71
|
+
...
|
|
58
72
|
@property
|
|
59
|
-
def ru_ixrss(self) -> int:
|
|
73
|
+
def ru_ixrss(self) -> int:
|
|
74
|
+
"""shared memory size"""
|
|
75
|
+
...
|
|
60
76
|
@property
|
|
61
|
-
def ru_idrss(self) -> int:
|
|
77
|
+
def ru_idrss(self) -> int:
|
|
78
|
+
"""unshared data size"""
|
|
79
|
+
...
|
|
62
80
|
@property
|
|
63
|
-
def ru_isrss(self) -> int:
|
|
81
|
+
def ru_isrss(self) -> int:
|
|
82
|
+
"""unshared stack size"""
|
|
83
|
+
...
|
|
64
84
|
@property
|
|
65
|
-
def ru_minflt(self) -> int:
|
|
85
|
+
def ru_minflt(self) -> int:
|
|
86
|
+
"""page faults not requiring I/O"""
|
|
87
|
+
...
|
|
66
88
|
@property
|
|
67
|
-
def ru_majflt(self) -> int:
|
|
89
|
+
def ru_majflt(self) -> int:
|
|
90
|
+
"""page faults requiring I/O"""
|
|
91
|
+
...
|
|
68
92
|
@property
|
|
69
|
-
def ru_nswap(self) -> int:
|
|
93
|
+
def ru_nswap(self) -> int:
|
|
94
|
+
"""number of swap outs"""
|
|
95
|
+
...
|
|
70
96
|
@property
|
|
71
|
-
def ru_inblock(self) -> int:
|
|
97
|
+
def ru_inblock(self) -> int:
|
|
98
|
+
"""block input operations"""
|
|
99
|
+
...
|
|
72
100
|
@property
|
|
73
|
-
def ru_oublock(self) -> int:
|
|
101
|
+
def ru_oublock(self) -> int:
|
|
102
|
+
"""block output operations"""
|
|
103
|
+
...
|
|
74
104
|
@property
|
|
75
|
-
def ru_msgsnd(self) -> int:
|
|
105
|
+
def ru_msgsnd(self) -> int:
|
|
106
|
+
"""IPC messages sent"""
|
|
107
|
+
...
|
|
76
108
|
@property
|
|
77
|
-
def ru_msgrcv(self) -> int:
|
|
109
|
+
def ru_msgrcv(self) -> int:
|
|
110
|
+
"""IPC messages received"""
|
|
111
|
+
...
|
|
78
112
|
@property
|
|
79
|
-
def ru_nsignals(self) -> int:
|
|
113
|
+
def ru_nsignals(self) -> int:
|
|
114
|
+
"""signals received"""
|
|
115
|
+
...
|
|
80
116
|
@property
|
|
81
|
-
def ru_nvcsw(self) -> int:
|
|
117
|
+
def ru_nvcsw(self) -> int:
|
|
118
|
+
"""voluntary context switches"""
|
|
119
|
+
...
|
|
82
120
|
@property
|
|
83
|
-
def ru_nivcsw(self) -> int:
|
|
121
|
+
def ru_nivcsw(self) -> int:
|
|
122
|
+
"""involuntary context switches"""
|
|
123
|
+
...
|
|
84
124
|
|
|
85
125
|
def getpagesize() -> int: ...
|
|
86
126
|
def getrlimit(resource: int, /) -> tuple[int, int]: ...
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module supports asynchronous I/O on multiple file descriptors.
|
|
3
|
+
|
|
4
|
+
*** IMPORTANT NOTICE ***
|
|
5
|
+
On Windows, only sockets are supported; on Unix, all file descriptors.
|
|
6
|
+
"""
|
|
7
|
+
|
|
1
8
|
import sys
|
|
2
9
|
from _typeshed import FileDescriptorLike
|
|
3
10
|
from collections.abc import Iterable
|
|
@@ -22,6 +29,12 @@ if sys.platform != "win32":
|
|
|
22
29
|
POLLWRNORM: int
|
|
23
30
|
|
|
24
31
|
class poll:
|
|
32
|
+
"""
|
|
33
|
+
Returns a polling object.
|
|
34
|
+
|
|
35
|
+
This object supports registering and unregistering file descriptors, and then
|
|
36
|
+
polling them for I/O events.
|
|
37
|
+
"""
|
|
25
38
|
def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ...
|
|
26
39
|
def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ...
|
|
27
40
|
def unregister(self, fd: FileDescriptorLike) -> None: ...
|
|
@@ -29,7 +42,32 @@ class poll:
|
|
|
29
42
|
|
|
30
43
|
def select(
|
|
31
44
|
rlist: Iterable[Any], wlist: Iterable[Any], xlist: Iterable[Any], timeout: float | None = None, /
|
|
32
|
-
) -> tuple[list[Any], list[Any], list[Any]]:
|
|
45
|
+
) -> tuple[list[Any], list[Any], list[Any]]:
|
|
46
|
+
"""
|
|
47
|
+
Wait until one or more file descriptors are ready for some kind of I/O.
|
|
48
|
+
|
|
49
|
+
The first three arguments are iterables of file descriptors to be waited for:
|
|
50
|
+
rlist -- wait until ready for reading
|
|
51
|
+
wlist -- wait until ready for writing
|
|
52
|
+
xlist -- wait for an "exceptional condition"
|
|
53
|
+
If only one kind of condition is required, pass [] for the other lists.
|
|
54
|
+
|
|
55
|
+
A file descriptor is either a socket or file object, or a small integer
|
|
56
|
+
gotten from a fileno() method call on one of those.
|
|
57
|
+
|
|
58
|
+
The optional 4th argument specifies a timeout in seconds; it may be
|
|
59
|
+
a floating point number to specify fractions of seconds. If it is absent
|
|
60
|
+
or None, the call will never time out.
|
|
61
|
+
|
|
62
|
+
The return value is a tuple of three lists corresponding to the first three
|
|
63
|
+
arguments; each contains the subset of the corresponding file descriptors
|
|
64
|
+
that are ready.
|
|
65
|
+
|
|
66
|
+
*** IMPORTANT NOTICE ***
|
|
67
|
+
On Windows, only sockets are supported; on Unix, all file
|
|
68
|
+
descriptors can be used.
|
|
69
|
+
"""
|
|
70
|
+
...
|
|
33
71
|
|
|
34
72
|
error = OSError
|
|
35
73
|
|
|
@@ -37,6 +75,22 @@ if sys.platform != "linux" and sys.platform != "win32":
|
|
|
37
75
|
# BSD only
|
|
38
76
|
@final
|
|
39
77
|
class kevent:
|
|
78
|
+
"""
|
|
79
|
+
kevent(ident, filter=KQ_FILTER_READ, flags=KQ_EV_ADD, fflags=0, data=0, udata=0)
|
|
80
|
+
|
|
81
|
+
This object is the equivalent of the struct kevent for the C API.
|
|
82
|
+
|
|
83
|
+
See the kqueue manpage for more detailed information about the meaning
|
|
84
|
+
of the arguments.
|
|
85
|
+
|
|
86
|
+
One minor note: while you might hope that udata could store a
|
|
87
|
+
reference to a python object, it cannot, because it is impossible to
|
|
88
|
+
keep a proper reference count of the object once it's passed into the
|
|
89
|
+
kernel. Therefore, I have restricted it to only storing an integer. I
|
|
90
|
+
recommend ignoring it and simply using the 'ident' field to key off
|
|
91
|
+
of. You could also set up a dictionary on the python side to store a
|
|
92
|
+
udata->object mapping.
|
|
93
|
+
"""
|
|
40
94
|
data: Any
|
|
41
95
|
fflags: int
|
|
42
96
|
filter: int
|
|
@@ -56,15 +110,53 @@ if sys.platform != "linux" and sys.platform != "win32":
|
|
|
56
110
|
# BSD only
|
|
57
111
|
@final
|
|
58
112
|
class kqueue:
|
|
113
|
+
"""
|
|
114
|
+
Kqueue syscall wrapper.
|
|
115
|
+
|
|
116
|
+
For example, to start watching a socket for input:
|
|
117
|
+
>>> kq = kqueue()
|
|
118
|
+
>>> sock = socket()
|
|
119
|
+
>>> sock.connect((host, port))
|
|
120
|
+
>>> kq.control([kevent(sock, KQ_FILTER_WRITE, KQ_EV_ADD)], 0)
|
|
121
|
+
|
|
122
|
+
To wait one second for it to become writeable:
|
|
123
|
+
>>> kq.control(None, 1, 1000)
|
|
124
|
+
|
|
125
|
+
To stop listening:
|
|
126
|
+
>>> kq.control([kevent(sock, KQ_FILTER_WRITE, KQ_EV_DELETE)], 0)
|
|
127
|
+
"""
|
|
59
128
|
closed: bool
|
|
60
129
|
def __init__(self) -> None: ...
|
|
61
|
-
def close(self) -> None:
|
|
130
|
+
def close(self) -> None:
|
|
131
|
+
"""
|
|
132
|
+
Close the kqueue control file descriptor.
|
|
133
|
+
|
|
134
|
+
Further operations on the kqueue object will raise an exception.
|
|
135
|
+
"""
|
|
136
|
+
...
|
|
62
137
|
def control(
|
|
63
138
|
self, changelist: Iterable[kevent] | None, maxevents: int, timeout: float | None = None, /
|
|
64
|
-
) -> list[kevent]:
|
|
65
|
-
|
|
139
|
+
) -> list[kevent]:
|
|
140
|
+
"""
|
|
141
|
+
Calls the kernel kevent function.
|
|
142
|
+
|
|
143
|
+
changelist
|
|
144
|
+
Must be an iterable of kevent objects describing the changes to be made
|
|
145
|
+
to the kernel's watch list or None.
|
|
146
|
+
maxevents
|
|
147
|
+
The maximum number of events that the kernel will return.
|
|
148
|
+
timeout
|
|
149
|
+
The maximum time to wait in seconds, or else None to wait forever.
|
|
150
|
+
This accepts floats for smaller timeouts, too.
|
|
151
|
+
"""
|
|
152
|
+
...
|
|
153
|
+
def fileno(self) -> int:
|
|
154
|
+
"""Return the kqueue control file descriptor."""
|
|
155
|
+
...
|
|
66
156
|
@classmethod
|
|
67
|
-
def fromfd(cls, fd: FileDescriptorLike, /) -> kqueue:
|
|
157
|
+
def fromfd(cls, fd: FileDescriptorLike, /) -> kqueue:
|
|
158
|
+
"""Create a kqueue object from a given control fd."""
|
|
159
|
+
...
|
|
68
160
|
|
|
69
161
|
KQ_EV_ADD: int
|
|
70
162
|
KQ_EV_CLEAR: int
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module provides access to the Unix shadow password database.
|
|
3
|
+
It is available on various Unix versions.
|
|
4
|
+
|
|
5
|
+
Shadow password database entries are reported as 9-tuples of type struct_spwd,
|
|
6
|
+
containing the following items from the password database (see `<shadow.h>'):
|
|
7
|
+
sp_namp, sp_pwdp, sp_lstchg, sp_min, sp_max, sp_warn, sp_inact, sp_expire, sp_flag.
|
|
8
|
+
The sp_namp and sp_pwdp are strings, the rest are integers.
|
|
9
|
+
An exception is raised if the entry asked for cannot be found.
|
|
10
|
+
You have to be root to be able to use this module.
|
|
11
|
+
"""
|
|
12
|
+
|
|
1
13
|
import sys
|
|
2
14
|
from _typeshed import structseq
|
|
3
15
|
from typing import Any, Final, final
|
|
@@ -5,6 +17,13 @@ from typing import Any, Final, final
|
|
|
5
17
|
if sys.platform != "win32":
|
|
6
18
|
@final
|
|
7
19
|
class struct_spwd(structseq[Any], tuple[str, str, int, int, int, int, int, int, int]):
|
|
20
|
+
"""
|
|
21
|
+
spwd.struct_spwd: Results from getsp*() routines.
|
|
22
|
+
|
|
23
|
+
This object may be accessed either as a 9-tuple of
|
|
24
|
+
(sp_namp,sp_pwdp,sp_lstchg,sp_min,sp_max,sp_warn,sp_inact,sp_expire,sp_flag)
|
|
25
|
+
or via the object attributes as named in the above tuple.
|
|
26
|
+
"""
|
|
8
27
|
if sys.version_info >= (3, 10):
|
|
9
28
|
__match_args__: Final = (
|
|
10
29
|
"sp_namp",
|
|
@@ -19,23 +38,53 @@ if sys.platform != "win32":
|
|
|
19
38
|
)
|
|
20
39
|
|
|
21
40
|
@property
|
|
22
|
-
def sp_namp(self) -> str:
|
|
41
|
+
def sp_namp(self) -> str:
|
|
42
|
+
"""login name"""
|
|
43
|
+
...
|
|
23
44
|
@property
|
|
24
|
-
def sp_pwdp(self) -> str:
|
|
45
|
+
def sp_pwdp(self) -> str:
|
|
46
|
+
"""encrypted password"""
|
|
47
|
+
...
|
|
25
48
|
@property
|
|
26
|
-
def sp_lstchg(self) -> int:
|
|
49
|
+
def sp_lstchg(self) -> int:
|
|
50
|
+
"""date of last change"""
|
|
51
|
+
...
|
|
27
52
|
@property
|
|
28
|
-
def sp_min(self) -> int:
|
|
53
|
+
def sp_min(self) -> int:
|
|
54
|
+
"""min #days between changes"""
|
|
55
|
+
...
|
|
29
56
|
@property
|
|
30
|
-
def sp_max(self) -> int:
|
|
57
|
+
def sp_max(self) -> int:
|
|
58
|
+
"""max #days between changes"""
|
|
59
|
+
...
|
|
31
60
|
@property
|
|
32
|
-
def sp_warn(self) -> int:
|
|
61
|
+
def sp_warn(self) -> int:
|
|
62
|
+
"""#days before pw expires to warn user about it"""
|
|
63
|
+
...
|
|
33
64
|
@property
|
|
34
|
-
def sp_inact(self) -> int:
|
|
65
|
+
def sp_inact(self) -> int:
|
|
66
|
+
"""#days after pw expires until account is disabled"""
|
|
67
|
+
...
|
|
35
68
|
@property
|
|
36
|
-
def sp_expire(self) -> int:
|
|
69
|
+
def sp_expire(self) -> int:
|
|
70
|
+
"""#days since 1970-01-01 when account expires"""
|
|
71
|
+
...
|
|
37
72
|
@property
|
|
38
|
-
def sp_flag(self) -> int:
|
|
73
|
+
def sp_flag(self) -> int:
|
|
74
|
+
"""reserved"""
|
|
75
|
+
...
|
|
76
|
+
|
|
77
|
+
def getspall() -> list[struct_spwd]:
|
|
78
|
+
"""
|
|
79
|
+
Return a list of all available shadow password database entries, in arbitrary order.
|
|
80
|
+
|
|
81
|
+
See `help(spwd)` for more on shadow password database entries.
|
|
82
|
+
"""
|
|
83
|
+
...
|
|
84
|
+
def getspnam(arg: str, /) -> struct_spwd:
|
|
85
|
+
"""
|
|
86
|
+
Return the shadow password database entry for the given user name.
|
|
39
87
|
|
|
40
|
-
|
|
41
|
-
|
|
88
|
+
See `help(spwd)` for more on shadow password database entries.
|
|
89
|
+
"""
|
|
90
|
+
...
|