def order_to_dict(order):
    """Convert an IBPy Order object to a dict containing any non-default values."""
    default = Order()
    return {field: val for field, val in vars(order).items() if val != getattr(default, field, None)}
def order_to_dict ( order ) : default = Order ( ) return { field : val for field , val in vars ( order ) . items ( ) if val != getattr ( default , field , None ) }
Convert an IBPy Order object to a dict containing any non-default values.