From c4a68faf6cff706d342a2b4a510180643127ed24 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sat, 8 Jan 2022 14:57:57 +0300 Subject: [PATCH] Use `Literal` type in `codecs` (#6857) --- stdlib/codecs.pyi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/codecs.pyi b/stdlib/codecs.pyi index e08672e51..a07ffcfc5 100644 --- a/stdlib/codecs.pyi +++ b/stdlib/codecs.pyi @@ -5,10 +5,10 @@ from abc import abstractmethod from typing import IO, Any, BinaryIO, Callable, Generator, Iterable, Iterator, Protocol, TextIO, Type, TypeVar, overload from typing_extensions import Literal -BOM32_BE: bytes -BOM32_LE: bytes -BOM64_BE: bytes -BOM64_LE: bytes +BOM32_BE: Literal[b"\xfe\xff"] +BOM32_LE: Literal[b"\xff\xfe"] +BOM64_BE: Literal[b"\x00\x00\xfe\xff"] +BOM64_LE: Literal[b"\xff\xfe\x00\x00"] # TODO: this only satisfies the most common interface, where # bytes is the raw form and str is the cooked form.