Reputation: 7081
I am looking for something like
list<float[]> foo
in thrift, I know I can use
list>
but just curious if there is any way to put an array into a list.
seems like java supports
List<float[]>
in python, like
[[]]
thanks!
Upvotes: 0
Views: 2387
Reputation: 13411
No, but you can of course have list< list< double>>
.
From https://thrift.apache.org/docs/types (only slightly redacted):
The base types were selected with the goal of simplicity and clarity rather than abundance, focusing on the key types available in all programming languages.
bool
: boolean value (true or false)i8
orbyte
: 8-bit signed integeri16
: 16-bit signed integeri32
: 32-bit signed integeri64
: 64-bit signed integerdouble
: 64-bit floating point numberstring
: text stringbinary
: sequence of unencoded byteslist<T>
: ordered list of elementsset<T>
: unordered set of unique elementsmap<K,V>
: map of strictly unique keys to valuesWhile defaults are provided, the type mappings are not explicitly fixed. Custom code generator directives have been added to allow substitution of custom types in various destination languages.
The latter paragraph highly depends on the target language, there is no general rule about what's possible and what isn't. The custom types can be introduced by means of IDL annotations.
Upvotes: 3