diff --git a/newsfragments/3221.doc.rst b/newsfragments/3221.doc.rst new file mode 100644 index 0000000000..f90aca8094 --- /dev/null +++ b/newsfragments/3221.doc.rst @@ -0,0 +1 @@ +Added docstrings for :attr:`~trio.lowlevel.ParkingLot.broken_by` and :meth:`~trio._subprocess.HasFileno.fileno`. diff --git a/src/trio/_core/_parking_lot.py b/src/trio/_core/_parking_lot.py index ddf6276117..c44661b5f5 100644 --- a/src/trio/_core/_parking_lot.py +++ b/src/trio/_core/_parking_lot.py @@ -152,6 +152,7 @@ class ParkingLot: # items _parked: OrderedDict[Task, None] = attrs.field(factory=OrderedDict, init=False) broken_by: list[Task] = attrs.field(factory=list, init=False) + """The list of tasks that have broken this lot via :meth:`break_lot`.""" def __len__(self) -> int: """Returns the number of parked tasks.""" diff --git a/src/trio/_subprocess.py b/src/trio/_subprocess.py index d73ba3dc23..33197e9ac8 100644 --- a/src/trio/_subprocess.py +++ b/src/trio/_subprocess.py @@ -98,7 +98,9 @@ def pidfd_open(fd: int, flags: int) -> int: class HasFileno(Protocol): """Represents any file-like object that has a file descriptor.""" - def fileno(self) -> int: ... + def fileno(self) -> int: + """Return the underlying file descriptor as an integer.""" + ... @final diff --git a/src/trio/_tests/_check_type_completeness.json b/src/trio/_tests/_check_type_completeness.json index e5414cfe56..309b4e13f3 100644 --- a/src/trio/_tests/_check_type_completeness.json +++ b/src/trio/_tests/_check_type_completeness.json @@ -25,7 +25,6 @@ "No docstring found for function \"trio._highlevel_socket.SocketStream.send_eof\"", "No docstring found for function \"trio._highlevel_socket.SocketStream.receive_some\"", "No docstring found for function \"trio._highlevel_socket.SocketStream.aclose\"", - "No docstring found for function \"trio._subprocess.HasFileno.fileno\"", "No docstring found for class \"trio._sync.AsyncContextManagerMixin\"", "No docstring found for function \"trio._sync._HasAcquireRelease.acquire\"", "No docstring found for function \"trio._sync._HasAcquireRelease.release\"",