#23796: Reduced reduce() usage
-------------------------------------+-------------------------------------
Reporter: bradmwalker | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Uncategorized | Resolution:
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Tim Graham <timograham@…>):
In [changeset:"54d3dcbc51819ea0e36bb4dbe7de1a1e33f62c4d"]:
{{{
#!CommitTicketReference repository=""
revision="54d3dcbc51819ea0e36bb4dbe7de1a1e33f62c4d"
Removed reduce() usage in makemigrations; refs #23796.
A lambda all_items_equal() replaced a reduce() that was broken for
potential
3+-way merges. A reduce(operator.eq, ...) accumulates bools and can't
generically check equality of all items in a sequence:
>>> bool(reduce(operator.eq, [('migrations', '0001_initial')] * 3))
False
The code now counts the number of common ancestors to calculate slice
offsets
for the branches. Each branch shares the same number of common ancestors.
The common_ancestor for loop statement had incomplete branch coverage.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23796#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/069.1bfb738583896b58a1f76f4cd054a7bd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.