Rodrigo Girão Serrão 🐍🚀 @mathspp.com · Jan 25

Python typing pop quiz. Take a look at the function `choice` shown below. Note how it's being called as `choice(3, "hey!")`. Will this type check or not? If it does, what's the revealed type? The right answer might surprise you! It surprised me. 🤷

1 likes 1 replies

?

Replies

Tamir Bahar · Jan 25

Seems like mypy, ty, and pyrefly are in disagreement about the result here. Which... isn't great, probably. mypy-play.net?mypy=latest&... play.ty.dev/3d703d87-f21... pyrefly.org/sandbox/?pro...