Skip to content

Commit

Permalink
typing of NoOutput might be better
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry1 committed Mar 17, 2024
1 parent 6379b8d commit 5d839e2
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/valuefragments/contextmanagers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
import time
from types import TracebackType
from typing import Any, Literal, Optional, TextIO, Type
from typing import Any, BinaryIO, Literal, Optional, TextIO, Type

# from typing_extensions import Self
from .helpers import ( # pylint: disable=relative-beyond-top-level]
Expand Down Expand Up @@ -46,6 +46,31 @@ def write(self: NoOutput, s: Any) -> int: # pylint: disable=invalid-name,unused
def flush(self: NoOutput) -> None:
"""Flush attribute: Needed but does nothing."""

# buffer | | encoding | | errors | | line_buffering newlines

@property
def buffer(self: NoOutput) -> BinaryIO:
"""Buffer: Needed but does nothing."""
return self.buffer

@property
def encoding(self: NoOutput) -> str:
"""Encoding: Needed but does nothing."""
return ""

@property
def errors(self: NoOutput) -> None:
"""Errors: Needed but does nothing."""

@property
def line_buffering(self: NoOutput) -> int:
"""Line_buffering: Needed but does nothing."""
return 0

@property
def newlines(self: NoOutput) -> None:
"""Newlines: Needed but does nothing."""


class LinuxTimeCM:
"""
Expand Down

0 comments on commit 5d839e2

Please sign in to comment.