, _AssociationList, : ""? ! (duck typing, . Python: , ( )).
def is_sequence(arg):
return (not hasattr(arg, "strip") and
hasattr(arg, "__getitem__") or
hasattr(arg, "__iter__"))
class MyEncoder(JSONEncoder):
def default(self, obj):
if is_sequence(obj):
return list(obj)
return JSONEncoder.default(self, obj)
, , _AssociationLists ! , int ..