KEMBAR78
Tweak TypeState to avoid getattrs under mypyc by msullivan · Pull Request #5726 · python/mypy · GitHub
Skip to content

Conversation

@msullivan
Copy link
Collaborator

mypyc optimizes accesses to Final class variables, but only when they
are made through a class name reference. Change TypeState to access
the caches via references to TypeState instead of cls.

This gets a modest perf win.

@msullivan msullivan requested a review from ilevkivskyi October 3, 2018 18:59
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this. Currently the methods are logically static anyway.

@msullivan msullivan merged commit 5949b8a into master Oct 3, 2018
TV4Fun pushed a commit to TV4Fun/mypy that referenced this pull request Oct 4, 2018
@gvanrossum gvanrossum deleted the typestate-final branch October 5, 2018 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants