Class Token

Synopsis

class Token(object)

Description

No description yet.

Inheritance

Ancestors: object

Decsendents: BlockSequenceStartToken, BlockEndToken, AnchorToken, FlowSequenceStartToken, AliasToken, StreamEndToken, DocumentEndToken, DirectiveToken, ValueToken, FlowSequenceEndToken, FlowMappingStartToken, TagToken, BlockEntryToken, FlowEntryToken, FlowMappingEndToken, StreamStartToken, BlockMappingStartToken, KeyToken, ScalarToken, DocumentStartToken

Methods

__init__
__repr__

Source

Lines 2-17 in lib3/yaml/tokens.py.

class Token(object):
    def __init__(self, start_mark, end_mark):
        self.start_mark = start_mark
        self.end_mark = end_mark
    def __repr__(self):
        attributes = [key for key in self.__dict__
                if not key.endswith('_mark')]
        attributes.sort()
        arguments = ', '.join(['%s=%r' % (key, getattr(self, key))
                for key in attributes])
        return '%s(%s)' % (self.__class__.__name__, arguments)

#class BOMToken(Token):
#    id = '<byte order mark>'

class DirectiveToken(Token):





Add Discussion as Guest

Log in