INNER CODE UNIT · Python
__init__
PyCQA/isort · isort/main.py:46
def __init__(self, incorrectly_sorted: bool, skipped: bool, supported_encoding: bool) -> None:
self.incorrectly_sorted = incorrectly_sorted
self.skipped = skipped
self.supported_encoding = supported_encoding
def __reduce__(self) -> tuple[type[SortAttempt], tuple[bool, bool, bool]]:
# Defined explicitly as mypyc's removal of `__dict__` breaks pickling this class, which is
# necessary when using multiple jobs.
return (self.__class__, (self.incorrectly_sorted, self.skipped, self.supported_encoding))
def _stream_with_preserved_newlines(
stream: TextIO, *, mode: Literal["r", "w"]
) -> AbstractContextManager[TextIO]:
if stream is not sys.stdin and stream is not sys.stdout:
return nullcontext(stream)
try:
stream_fileno = stream.fileno()