Skip to content

Commit 872e768

Browse files
author
typeshedbot
committed
Sync macOS docstrings
1 parent 4cf9d47 commit 872e768

File tree

7 files changed

+161
-17
lines changed

7 files changed

+161
-17
lines changed
Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
1+
"""This module contains functions for accessing NIS maps.
2+
"""
13
import sys
24

35
if sys.platform != "win32":
4-
def cat(map: str, domain: str = ...) -> dict[str, str]: ...
5-
def get_default_domain() -> str: ...
6-
def maps(domain: str = ...) -> list[str]: ...
7-
def match(key: str, map: str, domain: str = ...) -> str: ...
6+
def cat(map: str, domain: str = ...) -> dict[str, str]:
7+
"""cat(map, domain = defaultdomain)
8+
Returns the entire map as a dictionary. Optionally domain can be
9+
specified but it defaults to the system default domain.
10+
"""
11+
def get_default_domain() -> str:
12+
"""get_default_domain() -> str
13+
Corresponds to the C library yp_get_default_domain() call, returning
14+
the default NIS domain.
15+
"""
16+
def maps(domain: str = ...) -> list[str]:
17+
"""maps(domain = defaultdomain)
18+
Returns an array of all available NIS maps within a domain. If domain
19+
is not specified it defaults to the system default domain.
20+
"""
21+
def match(key: str, map: str, domain: str = ...) -> str:
22+
"""match(key, map, domain = defaultdomain)
23+
Corresponds to the C library yp_match() call, returning the value of
24+
key in the given map. Optionally domain can be specified but it
25+
defaults to the system default domain.
26+
"""
827

928
class error(Exception): ...

crates/ty_vendored/vendor/typeshed/stdlib/os/__init__.pyi

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -927,12 +927,18 @@ In the future, this property will contain the last metadata change time."""
927927
# On other Unix systems (such as FreeBSD), the following attributes may be
928928
# available (but may be only filled out if root tries to use them):
929929
@property
930-
def st_gen(self) -> int: ... # file generation number
930+
def st_gen(self) -> int: # file generation number
931+
"""generation number
932+
"""
931933
@property
932-
def st_birthtime(self) -> float: ... # time of file creation in seconds
934+
def st_birthtime(self) -> float: # time of file creation in seconds
935+
"""time of creation
936+
"""
933937
if sys.platform == "darwin":
934938
@property
935-
def st_flags(self) -> int: ... # user defined flags for file
939+
def st_flags(self) -> int: # user defined flags for file
940+
"""user defined flags for file
941+
"""
936942
# Attributes documented as sometimes appearing, but deliberately omitted from the stub: `st_creator`, `st_rsize`, `st_type`.
937943
# See https://github.com/python/typeshed/pull/6560#issuecomment-991253327
938944

@@ -1587,7 +1593,9 @@ Using non-zero flags requires Linux 4.7 or newer.
15871593
headers: Sequence[ReadableBuffer] = (),
15881594
trailers: Sequence[ReadableBuffer] = (),
15891595
flags: int = 0,
1590-
) -> int: ... # FreeBSD and Mac OS X only
1596+
) -> int: # FreeBSD and Mac OS X only
1597+
"""Copy count bytes from file descriptor in_fd to file descriptor out_fd.
1598+
"""
15911599

15921600
def readv(fd: int, buffers: SupportsLenAndGetItem[WriteableBuffer], /) -> int:
15931601
"""Read from a file descriptor fd into an iterable of buffers.
@@ -1766,8 +1774,21 @@ dir_fd and follow_symlinks may not be implemented on your platform.
17661774
"""
17671775

17681776
if sys.platform != "win32" and sys.platform != "linux":
1769-
def chflags(path: StrOrBytesPath, flags: int, follow_symlinks: bool = True) -> None: ... # some flavors of Unix
1770-
def lchflags(path: StrOrBytesPath, flags: int) -> None: ...
1777+
def chflags(path: StrOrBytesPath, flags: int, follow_symlinks: bool = True) -> None: # some flavors of Unix
1778+
"""Set file flags.
1779+
1780+
If follow_symlinks is False, and the last element of the path is a symbolic
1781+
link, chflags will change flags on the symbolic link itself instead of the
1782+
file the link points to.
1783+
follow_symlinks may not be implemented on your platform. If it is
1784+
unavailable, using it will raise a NotImplementedError.
1785+
"""
1786+
def lchflags(path: StrOrBytesPath, flags: int) -> None:
1787+
"""Set file flags.
1788+
1789+
This function will not follow symbolic links.
1790+
Equivalent to chflags(path, flags, follow_symlinks=False).
1791+
"""
17711792

17721793
if sys.platform != "win32":
17731794
def chroot(path: StrOrBytesPath) -> None:

crates/ty_vendored/vendor/typeshed/stdlib/select.pyi

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,21 @@ if sys.platform != "linux" and sys.platform != "win32":
7878
# BSD only
7979
@final
8080
class kevent:
81+
"""kevent(ident, filter=KQ_FILTER_READ, flags=KQ_EV_ADD, fflags=0, data=0, udata=0)
82+
83+
This object is the equivalent of the struct kevent for the C API.
84+
85+
See the kqueue manpage for more detailed information about the meaning
86+
of the arguments.
87+
88+
One minor note: while you might hope that udata could store a
89+
reference to a python object, it cannot, because it is impossible to
90+
keep a proper reference count of the object once it's passed into the
91+
kernel. Therefore, I have restricted it to only storing an integer. I
92+
recommend ignoring it and simply using the 'ident' field to key off
93+
of. You could also set up a dictionary on the python side to store a
94+
udata->object mapping.
95+
"""
8196
data: Any
8297
fflags: int
8398
filter: int
@@ -98,15 +113,48 @@ if sys.platform != "linux" and sys.platform != "win32":
98113
# BSD only
99114
@final
100115
class kqueue:
116+
"""Kqueue syscall wrapper.
117+
118+
For example, to start watching a socket for input:
119+
>>> kq = kqueue()
120+
>>> sock = socket()
121+
>>> sock.connect((host, port))
122+
>>> kq.control([kevent(sock, KQ_FILTER_WRITE, KQ_EV_ADD)], 0)
123+
124+
To wait one second for it to become writeable:
125+
>>> kq.control(None, 1, 1000)
126+
127+
To stop listening:
128+
>>> kq.control([kevent(sock, KQ_FILTER_WRITE, KQ_EV_DELETE)], 0)
129+
"""
101130
closed: bool
102131
def __init__(self) -> None: ...
103-
def close(self) -> None: ...
132+
def close(self) -> None:
133+
"""Close the kqueue control file descriptor.
134+
135+
Further operations on the kqueue object will raise an exception.
136+
"""
104137
def control(
105138
self, changelist: Iterable[kevent] | None, maxevents: int, timeout: float | None = None, /
106-
) -> list[kevent]: ...
107-
def fileno(self) -> int: ...
139+
) -> list[kevent]:
140+
"""Calls the kernel kevent function.
141+
142+
changelist
143+
Must be an iterable of kevent objects describing the changes to be made
144+
to the kernel's watch list or None.
145+
maxevents
146+
The maximum number of events that the kernel will return.
147+
timeout
148+
The maximum time to wait in seconds, or else None to wait forever.
149+
This accepts floats for smaller timeouts, too.
150+
"""
151+
def fileno(self) -> int:
152+
"""Return the kqueue control file descriptor.
153+
"""
108154
@classmethod
109-
def fromfd(cls, fd: FileDescriptorLike, /) -> kqueue: ...
155+
def fromfd(cls, fd: FileDescriptorLike, /) -> kqueue:
156+
"""Create a kqueue object from a given control fd.
157+
"""
110158

111159
KQ_EV_ADD: Final[int]
112160
KQ_EV_CLEAR: Final[int]

crates/ty_vendored/vendor/typeshed/stdlib/selectors.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ if sys.platform != "linux" and sys.platform != "darwin" and sys.platform != "win
163163

164164
if sys.platform != "win32" and sys.platform != "linux":
165165
class KqueueSelector(_BaseSelectorImpl):
166+
"""Kqueue-based selector.
167+
"""
166168
def fileno(self) -> int: ...
167169
def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ...
168170

crates/ty_vendored/vendor/typeshed/stdlib/tkinter/__init__.pyi

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,24 @@ corresponding attributes.
16481648
def wm_attributes(self, option: Literal["-topmost"], /) -> bool: ...
16491649
if sys.platform == "darwin":
16501650
@overload
1651-
def wm_attributes(self, option: Literal["-modified"], /) -> bool: ...
1651+
def wm_attributes(self, option: Literal["-modified"], /) -> bool:
1652+
"""This subcommand returns or sets platform specific attributes
1653+
1654+
The first form returns a list of the platform specific flags and
1655+
their values. The second form returns the value for the specific
1656+
option. The third form sets one or more of the values. The values
1657+
are as follows:
1658+
1659+
On Windows, -disabled gets or sets whether the window is in a
1660+
disabled state. -toolwindow gets or sets the style of the window
1661+
to toolwindow (as defined in the MSDN). -topmost gets or sets
1662+
whether this is a topmost window (displays above all other
1663+
windows).
1664+
1665+
On Macintosh, XXXXX
1666+
1667+
On Unix, there are currently no special attribute values.
1668+
"""
16521669
@overload
16531670
def wm_attributes(self, option: Literal["-notify"], /) -> bool: ...
16541671
@overload
@@ -1772,7 +1789,24 @@ corresponding attributes.
17721789
def wm_attributes(self, option: Literal["-topmost"], value: bool, /) -> Literal[""]: ...
17731790
if sys.platform == "darwin":
17741791
@overload
1775-
def wm_attributes(self, option: Literal["-modified"], value: bool, /) -> Literal[""]: ...
1792+
def wm_attributes(self, option: Literal["-modified"], value: bool, /) -> Literal[""]:
1793+
"""This subcommand returns or sets platform specific attributes
1794+
1795+
The first form returns a list of the platform specific flags and
1796+
their values. The second form returns the value for the specific
1797+
option. The third form sets one or more of the values. The values
1798+
are as follows:
1799+
1800+
On Windows, -disabled gets or sets whether the window is in a
1801+
disabled state. -toolwindow gets or sets the style of the window
1802+
to toolwindow (as defined in the MSDN). -topmost gets or sets
1803+
whether this is a topmost window (displays above all other
1804+
windows).
1805+
1806+
On Macintosh, XXXXX
1807+
1808+
On Unix, there are currently no special attribute values.
1809+
"""
17761810
@overload
17771811
def wm_attributes(self, option: Literal["-notify"], value: bool, /) -> Literal[""]: ...
17781812
@overload

crates/ty_vendored/vendor/typeshed/stdlib/webbrowser.pyi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,29 @@ if sys.platform == "darwin":
117117
if sys.version_info >= (3, 11):
118118
@deprecated("Deprecated since Python 3.11; removed in Python 3.13.")
119119
class MacOSX(BaseBrowser):
120+
"""Launcher class for Aqua browsers on Mac OS X
121+
122+
Optionally specify a browser name on instantiation. Note that this
123+
will not work for Aqua browsers if the user has moved the application
124+
package after installation.
125+
126+
If no browser is specified, the default browser, as specified in the
127+
Internet System Preferences panel, will be used.
128+
"""
120129
def __init__(self, name: str) -> None: ...
121130
def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
122131

123132
else:
124133
class MacOSX(BaseBrowser):
134+
"""Launcher class for Aqua browsers on Mac OS X
135+
136+
Optionally specify a browser name on instantiation. Note that this
137+
will not work for Aqua browsers if the user has moved the application
138+
package after installation.
139+
140+
If no browser is specified, the default browser, as specified in the
141+
Internet System Preferences panel, will be used.
142+
"""
125143
def __init__(self, name: str) -> None: ...
126144
def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
127145

crates/ty_vendored/vendor/typeshed/stdlib/xxlimited.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ else:
3333
class Null:
3434
__hash__: ClassVar[None] # type: ignore[assignment]
3535

36-
def roj(b: Any, /) -> None: ...
36+
def roj(b: Any, /) -> None:
37+
"""roj(a,b) -> None
38+
"""

0 commit comments

Comments
 (0)