Skip to content

Commit

Permalink
Add a bunch of encodings submodules (#13087)
Browse files Browse the repository at this point in the history

each file in this set is the exact same
  • Loading branch information
tungol authored Nov 24, 2024
1 parent 4059f3e commit 37eba41
Show file tree
Hide file tree
Showing 53 changed files with 1,092 additions and 7 deletions.
7 changes: 0 additions & 7 deletions stdlib/@tests/stubtest_allowlists/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,17 @@ encodings.gb18030
encodings.gb2312
encodings.gbk
encodings.hex_codec
encodings.hp_roman8
encodings.hz
encodings.idna
encodings\.iso2022_.*
encodings\.iso8859_\d+
encodings.johab
encodings\.koi8_\w
encodings.kz1048
encodings.latin_1
encodings\.mac_.+
encodings.palmos
encodings.ptcp154
encodings.punycode
encodings.quopri_codec
encodings.raw_unicode_escape
encodings.rot_13
encodings\.shift_jis.*
encodings.tis_620
encodings.undefined
encodings.unicode_escape
encodings.utf_16
Expand Down
21 changes: 21 additions & 0 deletions stdlib/encodings/cp037.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp1006.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp1026.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp1140.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp1250.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp1251.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp1252.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp1253.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp1254.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp1255.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp1256.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp1257.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp1258.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp273.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp424.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp500.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
21 changes: 21 additions & 0 deletions stdlib/encodings/cp720.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import codecs
from _codecs import _EncodingMap
from _typeshed import ReadableBuffer

class Codec(codecs.Codec):
def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ...

class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = False) -> bytes: ...

class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input: ReadableBuffer, final: bool = False) -> str: ...

class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...

def getregentry() -> codecs.CodecInfo: ...

decoding_table: str
encoding_table: _EncodingMap
Loading

0 comments on commit 37eba41

Please sign in to comment.