On Saturday, July 2, 2011 6:22:15 AM UTC-4, cjrh wrote:
>
> On Jul 1, 8:34 pm, pbreit <[email protected]> wrote:
> > I usually do extension=''
>
> What would extension=None do? It seems to make the most semantic
> sense, to me at least.
The code for URL does this:
if extension is None and r.extension != 'html':
extension = r.extension
So, extension=None results in the extension being set to request.extension
(unless that is already set to 'html'). If extension is set to anything that
evaluates to False (other than None), no extension will be added, as per
this code, which appears later:
if extension:
function += '.' + extension
So, None is a way of getting URL to propogate the current extension, and
anything else that evaluates to False ensures there is no extension.
Anthony