Elektrine lite

← Feed

@Gankra@toot.cat

Post #2272733

2025-11-11 13:57 UTC

anyway just learned python typing invented a new kind of voldemort type -- one which when named doesn't actually name it `float` and `int` are two distinct types in the type system but if you write `x: float` that actually means `x: float | int`. but if you write `x: float | int` that means `x: float | int | int`. anyway that's why `ty` has a `JustFloat` extension that is an actual alias for actual `float` that doesn't expand to `float | int`, so you can actual refer to... just float https://play.ty.dev/a8714369-9b4c-4028-9418-26727b546205

Replies (13)