#32971: System check methods can yield their items instead of creating lists at
every layer
-------------------------------------+-------------------------------------
Reporter: Chris Jerdonek | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Core (System | Version: dev
checks) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Chris Jerdonek):
> Thanks for this proposition, however it's ​documented that check
function must return a list of messages. Also, folks can extend checks at
any level, see ​examples. I don't think it's worth backward compatibility
concerns.
I was talking also about the internal check methods (e.g. the ones whose
names start with an underscore), which are called by the public methods.
Here is an example:
https://github.com/django/django/blob/f331eba6d576752dd79c4b37c41d981daa537fe6/django/db/models/fields/__init__.py#L198-L204
You can see the public method calling several internal methods --
unpacking each of their results to create the new list. Each internal
layer adds unnecessary list creations.
--
Ticket URL: <https://code.djangoproject.com/ticket/32971#comment:5>
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/067.107e76f6c653efb8c3d543f3a55b6f85%40djangoproject.com.