Opened 13 years ago

Closed 13 years ago

#16323 closed Uncategorized (invalid)

Typo in 'Raising 404' listing

Reported by: anonymous Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords: typo
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

in the 'Raising 404' listing there is a simple typo:
Http404 is a function that's why line 7 should be

raise Http404()

and not raise Http404

Change History (1)

comment:1 by Aymeric Augustin, 13 years ago

Resolution: invalid
Status: newclosed

Http404 is not a function; it's a class and it inherits Exception.

Python allows raising exceptions like this: http://docs.python.org/tutorial/errors.html#raising-exceptions

The sole argument to raise indicates the exception to be raised. This must be either an exception instance or an exception class (a class that derives from Exception).

A grep over the source and docs shows that both kinds or raise (with a class or an instance) are commonly used.

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