| Index: mojo/public/python/mojo_bindings/descriptor.py
|
| diff --git a/mojo/public/python/mojo_bindings/descriptor.py b/mojo/public/python/mojo_bindings/descriptor.py
|
| index 3f66e61b3339186b75f874edf9b691d832804026..f086aec365c4778d9103b4576c9166c8295d12f1 100644
|
| --- a/mojo/public/python/mojo_bindings/descriptor.py
|
| +++ b/mojo/public/python/mojo_bindings/descriptor.py
|
| @@ -102,12 +102,18 @@ class SerializableType(Type):
|
| raise NotImplementedError()
|
|
|
|
|
| -class BooleanType(Type):
|
| +class BooleanType(SerializableType):
|
| """Type object for booleans"""
|
|
|
| def Convert(self, value):
|
| return bool(value)
|
|
|
| + def Serialize(self, value, data_offset, data, handle_offset):
|
| + return (_ConvertBooleansToByte([value]), [])
|
| +
|
| + def Deserialize(self, value, context):
|
| + return _ConvertByteToBooleans(value)[0]
|
| +
|
|
|
| class NumericType(SerializableType):
|
| """Base Type object for all numeric types"""
|
| @@ -636,7 +642,7 @@ class MapType(SerializableType):
|
| return GenericArrayType(t)
|
|
|
|
|
| -TYPE_BOOL = BooleanType()
|
| +TYPE_BOOL = BooleanType('B')
|
|
|
| TYPE_INT8 = IntegerType('b')
|
| TYPE_INT16 = IntegerType('h')
|
|
|