#32280: Change all documentation examples using variable-length tuples into lists -------------------------------------------------+------------------------ Reporter: Adam (Chainz) Johnson | Owner: nobody Type: Cleanup/optimization | Status: new Component: Documentation | Version: master Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -------------------------------------------------+------------------------ In many places in the documentation we have examples using varible-length tuples, for example `ModelAdmin.fields` which takes any number of fields.
For all the reasons I wrote up in my post [https://adamj.eu/tech/2019/07/05/tuples-versus-lists-in-python/ tuples versus lists] I think it would be good to convert all such examples to lists. This would make the documentation more beginner-friendly and less prone to propagating these mistakes. There's also a general guideline I saw (from Guido maybe?) that tuples are intended for fixed-length records where the position is part of the meaning - e.g. `(x, y)` coordinates - and lists are for variable-length collections of homogenous-meaning items. So all our variable-length tuples would be better as lists under this guideline. -- Ticket URL: <https://code.djangoproject.com/ticket/32280> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/053.df7062059c7bf45675b71f5d0d649a45%40djangoproject.com.