33
31
def thrift_attrs(obj_or_cls):
35
33
return [v[2] for v in obj_or_cls.thrift_spec[1:]]
38
36
def thrift_type_to_dict(obj):
40
38
return dict((camel_case_to_pep8(attr), getattr(obj, attr))
41
39
for attr in thrift_attrs(obj))
49
48
This function increments the last byte that is smaller than ``0xFF``, and
50
49
drops everything after it. If the string only contains ``0xFF`` bytes,