#33014: ProjectState.__init__() can assume its real_apps argument is a set
------------------------------------------------+------------------------
Reporter: Chris Jerdonek | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+------------------------
[https://github.com/django/django/pull/14760 PR #14760] made all calls to
`ProjectState.__init__()` pass `real_apps` as a set. In
[https://github.com/django/django/blob/54a30a7a00fea6c5e3702282ade6e0238e06de3b/django/db/migrations/state.py#L95
ProjectState.__init__()] now, then, instead of checking that `real_apps`
is a set and converting it to a set if not, it can just `assert` that it's
a set when non-`None`. (Presumably the construction of new `ProjectState`
objects is part of Django's internal API.) I had made this comment on the
PR, but it wasn't important enough to hold up the PR because another PR
was depending on it getting merged.
--
Ticket URL: <https://code.djangoproject.com/ticket/33014>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.37a0e5f41b45a2c003031a9daf15a16e%40djangoproject.com.