Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ def autodoc_process_signature(

# currently undocumented things
logger = getLogger("trio")
UNDOCUMENTED = {
"trio._subprocess.HasFileno.fileno",
# ``ParkingLot.broken_by`` is a slotted attrs field; its documentation lives
# in the ``ParkingLot`` class docstring's ``Attributes:`` block.
UNDOCUMENTED: set[str] = {
"trio.lowlevel.ParkingLot.broken_by",
}

Expand Down
1 change: 1 addition & 0 deletions docs/source/reference-lowlevel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ Wait queue abstraction
.. autoclass:: ParkingLot
:members:
:undoc-members:
:exclude-members: broken_by

.. autoclass:: ParkingLotStatistics
:members:
Expand Down
3 changes: 3 additions & 0 deletions newsfragments/3221.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Filled in the missing documentation for ``trio._subprocess.HasFileno.fileno``
and ``trio.lowlevel.ParkingLot.broken_by``, which completes the checklist in
issue #3221.
4 changes: 4 additions & 0 deletions src/trio/_core/_parking_lot.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ class ParkingLot:
the number of parked tasks, and ``if parking_lot: ...`` to check whether
there are any parked tasks.

Attributes:
broken_by: The tasks that broke this parking lot, most recent
last. See :meth:`break_lot`.

"""

# {task: None}, we just want a deque where we can quickly delete random
Expand Down
7 changes: 6 additions & 1 deletion src/trio/_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ 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:
"""Returns the file descriptor of this file-like object, as an
integer. It is passed to the child process, e.g. when a
:class:`HasFileno` object is used as ``stdin``, ``stdout`` or
``stderr`` of a spawned process."""
...


@final
Expand Down
1 change: 0 additions & 1 deletion src/trio/_tests/_check_type_completeness.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"all": [
"No docstring found for class \"trio._core._run.Task\"",
"No docstring found for class \"trio._socket.SocketType\"",
"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\"",
Expand Down
Loading