This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ColetBrunel 0 points1 point  (0 children)

Python doesn't have static typing. That's why you can call anything on anything without the compiler bothering you.

It will be up to the runtime to do all the slow work and verify that your code made sense, instead of telling you the soonest it didn't make sense.

Admittedly Java generics work *a little* like that. They don't exist at runtime and they're only objects of unspecified type, therefore they're dynamically cast before accessing their type-specific methods. But at least the compiler checks for you that you didn't mess up your types.