I don’t know why floats aren’t included, but any float can be easily represented by an int with same bits, or a bytestring, using the struct module to convert between them, so there are clear workarounds.
Re:Faster CPython 3.12 Plan
by tylercrompton on Tuesday September 20, 2022 @12:47AM
(#32907764)
Fun fact, floats are easier than `int` because `float` has a predictable size.
Re:Faster CPython 3.12 Plan
by JoshTriplett on Tuesday September 20, 2022 @09:29AM
(#32911403)
> That's a really interesting detail - presumably channels can be passed so you can do callbacks ("reply on this other channel").
Callbacks or notifications, yes. I use both patterns quite often.
Sounds like an oversight…
> * None
> * bytes
> * str
> * int
> * channels
> Limiting the initial shareable types is a practical matter, reducing the potential complexity of the initial implementation.
That's a really interesting detail - presumably channels can be passed so you can do callbacks ("reply on this other channel").
I wonder why floats aren't on that list? I know they're more complex than ints, but I would expect they would still end up with a relatively simple binary representation.