From e022d5373d61096967446818469d6f6c4ad4e56f Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Fri, 23 May 2025 07:32:10 +0200 Subject: align HasFileno protocol with asyncvarlink --- linuxnamespaces/filedescriptor.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/linuxnamespaces/filedescriptor.py b/linuxnamespaces/filedescriptor.py index f9460bf..ee96a94 100644 --- a/linuxnamespaces/filedescriptor.py +++ b/linuxnamespaces/filedescriptor.py @@ -8,9 +8,15 @@ import os import typing +# pylint: disable=too-few-public-methods # It's that one method we describe. @typing.runtime_checkable class HasFileno(typing.Protocol): - def fileno(self) -> int: ... + """A typing protocol representing a file-like object and looking up the + underlying file descriptor. + """ + + def fileno(self) -> int: + """Return the underlying file descriptor.""" FileDescriptorLike = int | HasFileno -- cgit v1.2.3