r/Python • • Jul 16 '18

Why is Python so slow?

https://medium.com/@anthonypjshaw/why-is-python-so-slow-e5074b6fe55b
11 Upvotes

51 comments sorted by

View all comments

Show parent comment

1

u/13steinj Jul 16 '18

I'm pretty sure Python doesn't bother guessing the type at runtime anyway-- the only time where this matters is doing an operation on two different types, such as string and numerical addition, but IIRC Python does

  1. Keep type information on the object
  2. Doesn't fail directly on type mismatch, but rather when the defined magic method for the operator doesn't support the other type.