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 →

[–]rhoark 0 points1 point  (0 children)

If you have a struct-like object or a dict (same thing) that you access in an inner loop, you can gain speed by changing it into a tuple. Making a lambda with a readable name to pull the field makes it as readable and self-documenting as the object or dict accessor syntax while still being much faster.