Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#14194 closed (invalid)

MIssing comma in tutorial code

Reported by: GarryFre Owned by: nobody
Component: Uncategorized Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In the section about adding the poll app to the installed_apps array, there is a missing ending comma as shown below. The other variables show hanging commas so I assume this comma should be there and it did not complain about it. I am certain this would cause confusion and uncertainty for complete python/DJango newbies which the article is meant for.

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'mysite.polls' <-- Missing Comma!
)

Change History (2)

comment:1 by Russell Keith-Magee, 14 years ago

Resolution: invalid
Status: newclosed

There isn't a missing comma. The comma after the last element in a tuple is optional, unless the tuple has a single item. Both (a,b,c) and (a,b,c,) are legal.

comment:2 by Luke Plant, 14 years ago

Just to add to what Russell said: although the tutorial is meant for Django newbies, it isn't targeted primarily at Python newbies. We are not going to stop to explain anything which is straightforward Python syntax, since that is best done elsewhere.

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