Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force keys to str instances #88

Closed
asvetlov opened this issue Jun 7, 2017 · 0 comments
Closed

Force keys to str instances #88

asvetlov opened this issue Jun 7, 2017 · 0 comments

Comments

@asvetlov
Copy link
Member

asvetlov commented Jun 7, 2017

Right now a key type is dark corner: it could be str, istr or something other.
For sake of further optimizations it should be str always.

Passing istr as key to any miltidict API is still allowed and encouraged: it saves execution time by getting rid of s.title() conversion.

But istr type is ambiguous by it nature: we can define equality for str and istr by comparing their canonical representations but ordering is cumbersome.
Ordering by canonical reprs leads to very tricky errors, the same for original reprs.
Also CPython is very optimized for str but not classes derived from it.

I believe the change doesn't touch our users but aiohttp might get speedup on implementing the issue.

asvetlov added a commit that referenced this issue Jun 8, 2017
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

No branches or pull requests

1 participant