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

Fixed #27513 -- Made Signal.send/send_robust a tiny bit faster #7581

Merged
merged 1 commit into from Nov 22, 2016

Conversation

adamchainz
Copy link
Sponsor Member

@adamchainz adamchainz commented Nov 20, 2016

Copy link
Member

@MarkusH MarkusH left a comment

Choose a reason for hiding this comment

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

LGTM

@adamchainz
Copy link
Sponsor Member Author

Hang about, just realized send with receivers can be optimized with a list comp.

@adamchainz adamchainz changed the title Fixed #27513 -- Made Signal.send a tiny bit faster when there are no listeners Fixed #27513 -- Made Signal.send/send_robust a tiny bit faster Nov 20, 2016
@adamchainz
Copy link
Sponsor Member Author

Test failures are all in settings_tests.tests.TestComplexSettingOverride.test_complex_override_warning which seems unrelated

@charettes
Copy link
Member

I'm not sure yet about what's causing the failure but I can reproduce locally on Python 3.5 with your patch and cannot without it.

@adamchainz
Copy link
Sponsor Member Author

Oh yes, maybe something about override_settings's signal is broken 😢

@charettes
Copy link
Member

charettes commented Nov 20, 2016

@adamchainz it's alright you just have to change the stacklevel to 6 here which is relying on the internal of the signaling infrastructure.

@charettes
Copy link
Member

Actually you'll have to make it 6 only on Python3. Use 5 if django.utils.six.PY2 else 6.

@charettes
Copy link
Member

I think this is related to the scoping rule changes of list comprehension in Python 3.

@adamchainz
Copy link
Sponsor Member Author

Yes makes sense. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants