Thanks for your update, Tom!

1. I think `route` is used in Django Channels (haven't looked it up. Not
a real issue but something to think about). I'd prefer `path` instead.

2. Too much magic for my taste. I like the explicit name `typed_url`
though (if we stick with `url` as opposed to `path` as per 1.). So
either `regex_url` and `typed_url` or `regex_path` and `typed_path`.
Either one with a import chim for `django.conf.urls.url` to point to
`regex_url` or `regex_path`.

3. Consider me -0 to -1 on deprecating `url()`. If we "rename" `url` to
`path` I'd rather see the docs updated and have a chim around for _a
while_. It's unnecessary work for every user to fix this in _every_
Django project.

/Markus

On Tue, Oct 04, 2016 at 02:17:00AM -0700, Tom Christie wrote:
Some possibilities:

1. Use a different name for the new function.

   path('/users/<int:pk>/')

Actually `path` is pretty valid as a name there - that's *exactly* what it
represents - the path portion of the URL.
Alternately `route`?

2. Keep `url` for both styles, but with a really simple determination
between regexs/typed urls.

   The pattern *must* start with either `^` or `/`.  (Include a
`regex_url` and `typed_url` for the explicit cases)

3. As per (2) but additionally have the usage of regexs in `url(...)` be
placed on the deprecation path.

I think (1) is probably my favorite choice of those, but I'm open to
discussion.
That'd give us `from django.conf import path`, and `from django.conf import
regex_path`. The existing `from django.conf.urls import url` would keep the
existing behavior but move towards deprecation.

I'm very strongly in favor of keeping Flask's style for "<type:name>".
Considering the wider ecosystem, the choice between having Python's two
biggest web frameworks share the same routing syntax vs. having them share
subtly different syntaxes is pretty clear.
I think that's a far bigger concern that if the routing syntax echos
Python's type hinting syntax or not.

To me, the alternative reads like this:

A: "Hey folks! Django's got a new routing sytnax!"
B: "Great what's it like?"
A: "Exactly the same as Flask. Oh, but we've reversed two of the arguments
around."
B: "Uh, WTF?"

Cheers for the input everyone,

 Tom


--
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/20161004092630.GC2270%40inel.local.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: PGP signature

Reply via email to