> Without raising eventually-loud deprecation warnings (further along in the cycle), people who still have url() in their codebases might never even find out that the simplified DEP 201 URL routing is available. Raising a deprecation warning makes sure they find out; some projects will undoubtedly just find-and-replace url() to re_path(), but others will probably be happy to find out that the simpler path() routing exists.
Yes, I'm totally fine with raising a warning, as it brings path() to people's attention. I just think the url() -> re_path() migration should be an optional thing. People who care about code quality will see the warning and make the change. Those who don't care about slighty higher code quality will get a warning, but at least Django isn't forcing them to do something they don't care at all about. Their code will still run just fine on newer versions of Django. On Tuesday, May 5, 2020 at 1:04:02 PM UTC-4, James Bennett wrote: > > On Tue, May 5, 2020 at 8:42 AM Collin Anderson <cmawe...@gmail.com > <javascript:>> wrote: > > Is this really worth it? It's only a few lines of code to keep backward > compatibility, and it seems to me it would take almost no work to maintain > that compatibility shim compared to the countless programmer hours needed > to upgrade their code, including many unpaid programmers working on open > source projects. I'll personally need to do a find/replace for url() to > re_path() across my ~20 projects, and update all of the imports. Isn't this > useless code churn? > > I think it should be deprecated and removed. > > On the one hand, we're talking about an extremely long (~7 years) > timeline from when re_path() was introduced to when it would become > mandatory for projects that need regex-based URL routing. That seems > like plenty of time for projects to notice that a new URL routing > approach was adopted. And that's a long, *long* time to keep > effectively-dead code in Django, far longer than what the normal > deprecation cycle would be. > > On the other hand, if it doesn't get removed, it sets a bad precedent > -- Django needs to be able to evolve over time, and part of that is > ensuring that once something is no longer the recommended approach it > gets removed from the framework. Without raising eventually-loud > deprecation warnings (further along in the cycle), people who still > have url() in their codebases might never even find out that the > simplified DEP 201 URL routing is available. Raising a deprecation > warning makes sure they find out; some projects will undoubtedly just > find-and-replace url() to re_path(), but others will probably be happy > to find out that the simpler path() routing exists. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/9e746ca4-97b8-4fd0-8bfb-4fa377c26b87%40googlegroups.com.