Function __init__

Synopsis

def __init__(self, stream)

Description

No description yet.

Source

Lines 59-86 in lib3/yaml/reader.py.

def __init__(self, stream):
    self.name = None
    self.stream = None
    self.stream_pointer = 0
    self.eof = True
    self.buffer = ''
    self.pointer = 0
    self.raw_buffer = None
    self.raw_decode = None
    self.encoding = None
    self.index = 0
    self.line = 0
    self.column = 0
    if isinstance(stream, str):
        self.name = "<unicode string>"
        self.check_printable(stream)
        self.buffer = stream+'\0'
    elif isinstance(stream, bytes):
        self.name = "<byte string>"
        self.raw_buffer = stream
        self.determine_encoding()
    else:
        self.stream = stream
        self.name = getattr(stream, 'name', "<file>")
        self.eof = False
        self.raw_buffer = None
        self.determine_encoding()





Add Discussion as Guest

Log in