Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Updated the documentation for patterns() to note Python's 255 argumen…

…t limit.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7d7119897c3d2367f7d68d34240820b1ddf6927a 1 parent 7d2a8f0
@malcolmt malcolmt authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 docs/url_dispatch.txt
22 docs/url_dispatch.txt
@@ -190,6 +190,28 @@ The remaining arguments should be tuples in this format::
...where ``optional dictionary`` and ``optional name`` are optional. (See
`Passing extra options to view functions`_ below.)
+.. note::
+ Since `patterns()` is a function call, it accepts a maximum of 255
+ arguments (URL patterns, in this case). This is a limit for all Python
+ function calls. This will rarely be problem in practice, since you'll
+ typically structure your URL patterns modularly by using `include()`
+ sections. However, on the off-chance you do hit the 255-argument limit,
+ realise that `patterns()` returns a Python list, so you can split up the
+ construction of the list.
+ ::
+ urlpatterns = patterns('',
+ ...
+ )
+ urlpatterns += patterns('',
+ ...
+ )
+ Python lists have unlimited size, so there's no limit to how many URL
+ patterns you can construct; merely that you may only create 254 at a time
+ (the 255-th argument is the initial prefix argument).

0 comments on commit 7d71198

Please sign in to comment.
Something went wrong with that request. Please try again.