def obj(context, nodes, **attrs):
    """
    Creates Python object with the attributes created from named matches.
    This action is used as default action for rules with named matches.
    """
    grammar = context.parser.grammar
    rule_name = context.production.symbol.fqn
    cls = grammar.classes[rule_name]
    instance = cls(**attrs)
    instance._pg_start_position = context.start_position
    instance._pg_end_position = context.end_position
    return instance
