I have a PR to add empty_set and empty_array constructors. They take a type argument: hl.empty_array(hl.tint32)
.
I think I’d rather write hl.array([], type=hl.tint32)
. This is slightly tricky, what about hl.array(<set-of-int32>, type=hl.tdouble64
? Does that do a per-element conversion, or throw an error? What about hl.array({1, 2, 3}, type=hl.tdouble64)
?
Similarly I’d also like hl.lit(5, type=hl.tint32)
(once we replace broadcast and capture with lit), where the type is optional. Should it also do type conversion when converting from Python to expressions? E.g. hl.lit(5, type=hl.tdouble64)
? Does lit
only take Python objects or does it also pass through Expression
s?
Finally, I feel like it would be nice to have a non-*args
array constructor a la Python []
in addition to the list
-like conversion operator. Any suggestions on what to do call it? (Please, don’t say c
.)