Guido van Rossum
๐ค SpeakerAppearances Over Time
Podcast Appearances
And so we can generate an add integer instruction, but we can still have a fallback that says,
oh, if somehow the code at runtime provided something else, maybe it provided two decimal numbers, we can still use that generic add operation as a fallback, but we're not there.
There are third-party libraries that are in that business.
It seems like a tricky thing.
Well, what we actually do is, and I think this is a fairly unique feature in Python, the type hints can be introspected at runtime.
So while the program is running,
They mean Python is a very introspectable language.
You can look at a variable and ask yourself, what is the type of this variable?
And if that variable happens to refer to a function, you can ask, what are the arguments to the function?
And nowadays, you can also ask, what are the type annotations for the function?
They're mostly associated with the function object, not with each individual variable, but you can sort of map from the arguments to the variables.
And that's what a third-party library can help with.
Exactly.
And the problem with that is that all that extra runtime type checking...
is going to slow your code down instead of speed it up.
And in most cases, doing it...
statically before you ship your code to production is more efficient than doing it at runtime piecemeal.
Yeah.
Well, so MyPi was started by a Finnish developer, Jukka Letuselo.
So many cool things out of Finland, I got to say.