Defaulting to 'html' is not what we want. In general, we don't want to see explict 'html' extensions in our urls. Instead, web2py is set up to interpret urls without extensions as 'html' view requests. If you explicitly pass 'html' to URL() as the extension, it will add it to the URL -- otherwise, we don't want URL() to propagate the .html extension of the current request. However, we do want it to progagate the extension of the current request when (a) no explicit extension has been provided, (b) the current request extension is anything but 'html', and (c) there is an indication that propagation is desired, which is currently done via None (which is the default). I think you're taking issue with the fact that None is used to acheive (c). Perhaps that could have been indicated differently, and None could have been treated the same as False, but alas, backward compatibility prevents a change at this point. Anthony
On Saturday, July 2, 2011 12:37:34 PM UTC-4, cjrh wrote: > On Saturday, 2 July 2011 16:57:11 UTC+2, Jonathan Lundell wrote: >> >> On Jul 2, 2011, at 7:41 AM, Anthony wrote: >> > On Saturday, July 2, 2011 6:22:15 AM UTC-4, cjrh wrote: >> >> So, extension=None is saying that we're going to stick with the same >> extension as the current request, and if it happens to be 'html', we'll >> preserve that as well, but leave it implicit. >> >> extension=False (or anything that evaluates to False) is saying >> explicitly: no extension at all. >> > > Wouldn't it be a lot better if the default argument was > "extension='.html'"? I don't see why None should mean "use .html", when a > default arg of ".html" could do the job even better. I should think that > None and False should be synonymous in this case, and IMO None is better > than False. >