Opened 6 months ago

Closed 6 months ago

#28930 closed Cleanup/optimization (fixed)

Simplify code with all() and any()

Reported by: Дилян Палаузов Owned by: nobody
Component: Core (Other) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Attachments (1)

any_all.patch (17.4 KB) - added by Дилян Палаузов 6 months ago.

Download all attachments as: .zip

Change History (12)

Changed 6 months ago by Дилян Палаузов

Attachment: any_all.patch added

comment:1 Changed 6 months ago by Claude Paroz

Triage Stage: UnreviewedAccepted

Thanks, please provide a pull request.

comment:2 Changed 6 months ago by Srinivas Reddy Thatiparthy

Description: modified (diff)

comment:3 Changed 6 months ago by Srinivas Reddy Thatiparthy

Description: modified (diff)

What is the policy for taking this patch and raising a PR? Ofcourse, I acknowledge the author.

I like this patch very much, i couldn't resist to raise a PR. If i break the unspoken rules, please close the PR.

https://github.com/django/django/pull/9493

comment:4 Changed 6 months ago by Tim Graham

Component: UncategorizedCore (Other)
Has patch: set
Summary: Utilize all()/any()Simplify code iwth all() and any()
Triage Stage: AcceptedReady for checkin

That's fine. For future reference, the way to credit the patch author is using git commit --amend --author="Дилян Палаузов <Dilyan.Palauzov@db.com>". It would have been nice if you fixed up the flake8 issues and the failing lists, but I've done that. I also reverted changes to vendored code like six.py and an incorrect change in admin/utils.py which changed behavior and broke a test.

comment:5 Changed 6 months ago by Tim Graham

Summary: Simplify code iwth all() and any()Simplify code with all() and any()

comment:6 Changed 6 months ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In 4c599ece:

Fixed #28930 -- Simplified code with any() and all().

comment:7 Changed 6 months ago by Дилян Палаузов

Resolution: fixed
Status: closednew

What happened to the changes in django/utils/translation/trans_real.py and tests/schema/tests.py ?

comment:8 Changed 6 months ago by Tim Graham <timograham@…>

In 5f45640:

Refs #28930 -- Simplified schemas test with any().

comment:9 Changed 6 months ago by Tim Graham

Resolution: fixed
Status: newclosed

Changes were made to django/utils/translation/trans_real.py in the original patch.

comment:10 Changed 6 months ago by Дилян Палаузов

Resolution: fixed
Status: closednew

I wrote django/utils/translation/trans_real.py but I meant django/utils/http.py .

comment:11 Changed 6 months ago by Tim Graham

Resolution: fixed
Status: newclosed

As the docstring indicates, that code is copied from cpython so I didn't want to make substantial changes to it.

Note: See TracTickets for help on using tickets.
Back to Top