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

Prevent wild assignment in DEBUG mode only #2860

Merged
merged 1 commit into from
Mar 21, 2018

Conversation

asvetlov
Copy link
Member

For sake of performance

Related to #2834

@asvetlov asvetlov added this to the 3.1 milestone Mar 20, 2018
@codecov-io
Copy link

codecov-io commented Mar 20, 2018

Codecov Report

Merging #2860 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2860      +/-   ##
==========================================
+ Coverage   97.97%   97.97%   +<.01%     
==========================================
  Files          39       39              
  Lines        7444     7447       +3     
  Branches     1307     1309       +2     
==========================================
+ Hits         7293     7296       +3     
  Misses         48       48              
  Partials      103      103
Impacted Files Coverage Δ
aiohttp/web_app.py 99.08% <100%> (ø) ⬆️
aiohttp/web_request.py 99.69% <100%> (ø) ⬆️
aiohttp/helpers.py 96.83% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b432ab3...9cf70d4. Read the comment docs.

@spcharc
Copy link
Contributor

spcharc commented Mar 20, 2018

I like it.
but would this check impact performance?
of course disabling it would be better, I just wonder the extent

@asvetlov
Copy link
Member Author

Yes, technically it is a Python function call on every internal attribute assignment.
Very cheap if the check is implemented by CPython C/Cython but quite expensive if __setattr__ is a pure Python function.

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants