import json


def toJSON(py_object):
    """Convert an object to JSON string using its __dict__

    :param py_object: object to create a JSON string of
    """

    return json.dumps(py_object, default=lambda o: o.__dict__)