Link Search Menu Expand Document

arena-py API v1.0.1

arena.base_object

class BaseObjectJSONEncoder(json.encoder.JSONEncoder):

Custom JSON encoder for nested BaseObjects.

def default(self, obj):

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this::

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
Inherited Members
json.encoder.JSONEncoder
JSONEncoder
item_separator
key_separator
skipkeys
ensure_ascii
check_circular
allow_nan
sort_keys
indent
encode
iterencode
class BaseObject:

Basic Building Block for everything in arena-py. Can easily be interpreted and used like a JSON-able Python dictionary.

BaseObject(**kwargs)
def add(self, name, attr):
def json_encode(self, d):
def json(self, **kwargs):

Table of contents