Post #2272733
2025-11-11 13:57 UTC
Replies (13)
-
@Gankra@toot.cat 2025-11-11 14:03
`complex` is `complex | float | int` :)
-
@ldvsoft@fosstodon.org 2025-11-11 14:00
@Gankra@toot.cat waaat
-
@typeswitch@gamedev.lgbt 2025-11-11 14:07
@Gankra@toot.cat oh so it's a bit like subtypes? i guess with all of the implicit conversions that happen in python's arithmetic it kind of makes sense. oh! maybe the reason was so you can pass an integer literal to a function expecting a float.
-
@mindpersephone@spookygirl.boo 2025-11-11 14:18
@Gankra@toot.cat huh til typea | typea isn't an error
-
@apmasell@mastodon.social 2025-11-11 15:02
@Gankra@toot.cat have you encountered the psychic damage that `bool` is a subtype of `int` for reasons?
-
@mansalia@shitpost.poridge.club 2025-11-11 15:31
@Gankra@toot.cat Why does python make things needlessly complicated for library devs
-
@Kroc@oldbytes.space 2025-11-11 16:23
@Gankra@toot.cat Schrödinger’s duck typing. It's a duck, until you actually check and discover it's The Thing underneath.
-
@ucodery@fosstodon.org 2025-11-11 20:15
@Gankra@toot.cat Is this just the consequences of treating the numeric tower equivalent totally the actual instance types?
-
@siguza@infosec.space 2025-11-11 23:02
@Gankra@toot.cat Voldemort can float, so I guess that checks out...
-
@ignaloidas@not.acu.lt 2025-11-12 00:27
@Gankra@toot.cat People adding types to Python have been doing some serious bullshit that has little to do with how people use Python or types in Python for a long time Funny consequence of this - x.hex() is invalid, because only float has .hex(), int doesn't.
-
@Girgias@phpc.social 2025-11-12 00:55
@Gankra@toot.cat I can somehow see the logic, because in PHP `float` accepts `int` values by coercing them into floats, but it doesn't "expand" into a union type. Because we *do* have functions that have return types and parameter types which are marked as `int|float`.
-
@johoda@is.nota.live 2025-11-12 15:09
@Gankra@toot.cat 1.0 is mathematically an integer, checkmate athiests
-
@valorzard@mastodon.gamedev.place 2025-11-14 03:18
@Gankra@toot.cat man type systems are weird. I still don't fully understand what dependent types are and how they lead to proofs exactly