Re: Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-27 Thread Tim Graham
I created a ticket and pull request for the deprecation: https://code.djangoproject.com/ticket/27648 https://github.com/django/django/pull/7749 On Friday, December 23, 2016 at 10:22:40 AM UTC-5, Tim Graham wrote: > > I found a flask thread [0] where Armin Ronacher said this about > case-insensit

Re: Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-23 Thread Tim Graham
I found a flask thread [0] where Armin Ronacher said this about case-insensitive URLs: "I think it's a horrible idea. It destroys your caching and creates multiple entries for search engines." Adam Oakman added: "Agreed. My personal method is to code the 404 handler to look for uppercase chara

Re: Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-20 Thread Marten Kenbeek
This issue is actually limited to reverse(). When resolving urls, each nested regex is matched against the url separately, so you can just apply the flags to the "local" regex pattern, and get: a/c/ a/C/ a/b/ matching, but not: A/c/ A/C/ A/b/ The behaviour for reverse() can be a problem. For

Re: Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-20 Thread Shai Berger
I think part of Sjoerd's point was that current implementation also means that including the flag in a child affects parents -- but only with regard to said child. So, if you have url('a/', include("b")) and in b: url('b/$', blah), url('c/$', bleh, flags=re.I), then the valid urls include a

Re: Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-20 Thread Adam Johnson
I think the current implementation means they affect all included children. On 20 December 2016 at 07:15, Sjoerd Job Postmus wrote: > On Mon, Dec 19, 2016 at 08:23:09AM +, Adam Johnson wrote: > > > > > > I guess the "safest" option is to keep the code around and let this > > > feature die w

Re: Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-19 Thread Sjoerd Job Postmus
On Mon, Dec 19, 2016 at 08:23:09AM +, Adam Johnson wrote: > > > > I guess the "safest" option is to keep the code around and let this > > feature die when the deprecation ends in Python 3.7 (and meanwhile see if > > anyone notices the deprecation warning in their code and files a ticket > > ab

Re: Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-19 Thread Adam Johnson
> > I guess the "safest" option is to keep the code around and let this > feature die when the deprecation ends in Python 3.7 (and meanwhile see if > anyone notices the deprecation warning in their code and files a ticket > about it). The only extra work compared to removing this now is silencing

Re: Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-18 Thread Tim Graham
Only case insensitive matching was tested in the URL tests and none of this is documented. That's the only flag where I see a straightforward use case (but I avoid regexes of any complexity and didn't even know what the flags were for until I just looked them up), even if case-insensitive URLs a

Re: Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-18 Thread Adam Johnson
Since they were used in several places in Django's test suite I feel like it's highly likely they're out there in use in the wild. Also if Django were to remove it, it would both 1) be a bit surprising compared to the re module, as it's an implementation detail that the urlparser prefixes '^/' an

Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-16 Thread Tim Graham
Python deprecated usage of flags not at the start of a regular expression [0], e.g. 'CaseInsensitive(?i)' instead of '(?i)CaseInsensitive'. Deprecation warnings shows up in a few URL tests that are using (?i) to get case-insensitive matching of URLpatterns. However, because the URL resolver pre