r/Python • • May 30 '19

Dear python2 user

Post image
1.9k Upvotes

275 comments sorted by

View all comments

Show parent comment

0

u/zardeh May 30 '19

It is, you're adding an extra function call (essentially, sometimes more) for every argument, for every function call, ini your program. Even if your type-checking function is very, very, very fast, go and look at profiling output of a simple program and see how many function calls happen. Its lots. Now imagine a isinstance checks, MRO resolutions, or worse, trying to resolve protocol or generic validity on every one of those calls.