1 """ Python 'ascii' Codec
4 Written by Marc-Andre Lemburg (mal@lemburg.com).
6 (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
13 class Codec(codecs
.Codec
):
15 # Note: Binding these as C functions will result in the class not
16 # converting them to methods. This is intended.
17 encode
= codecs
.ascii_encode
18 decode
= codecs
.ascii_decode
20 class IncrementalEncoder(codecs
.IncrementalEncoder
):
21 def encode(self
, input, final
=False):
22 return codecs
.ascii_encode(input, self
.errors
)[0]
24 class IncrementalDecoder(codecs
.IncrementalDecoder
):
25 def decode(self
, input, final
=False):
26 return codecs
.ascii_decode(input, self
.errors
)[0]
28 class StreamWriter(Codec
,codecs
.StreamWriter
):
31 class StreamReader(Codec
,codecs
.StreamReader
):
34 class StreamConverter(StreamWriter
,StreamReader
):
36 encode
= codecs
.ascii_decode
37 decode
= codecs
.ascii_encode
39 ### encodings module API
42 return codecs
.CodecInfo(
46 incrementalencoder
=IncrementalEncoder
,
47 incrementaldecoder
=IncrementalDecoder
,
48 streamwriter
=StreamWriter
,
49 streamreader
=StreamReader
,