Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow starting variables with an underscore #1379

Merged
merged 1 commit into from
Nov 7, 2016

Conversation

arthurdarcet
Copy link
Contributor

This allows the named resources identifiers to start with an underscore

Mongo ids are useful as a named resource in a route, but they are usually named _id and are excluded by the current regex

If this isn't an acceptable change, then the documentation should imo be updated to specify what is an acceptable route identifier ([a-zA-Z][_a-zA-Z0-9]* currently)

Mongo ids are useful as a named resource in a route, but they are usually named `_id` and are excluded by the current regex
@codecov-io
Copy link

codecov-io commented Nov 7, 2016

Current coverage is 98.78% (diff: 100%)

Merging #1379 into master will not change coverage

@@             master      #1379   diff @@
==========================================
  Files            29         29          
  Lines          6762       6762          
  Methods           0          0          
  Messages          0          0          
  Branches       1123       1123          
==========================================
  Hits           6680       6680          
  Misses           38         38          
  Partials         44         44          

Powered by Codecov. Last update 4ff21c2...abfa1be

@asvetlov asvetlov merged commit 2533368 into aio-libs:master Nov 7, 2016
@asvetlov
Copy link
Member

asvetlov commented Nov 7, 2016

The change is good to me.
The idea is: route variable names should accept everything that is good for python variables themselves.
Thus I'm ok even with adding non-ascii names on first demand :)

@asvetlov
Copy link
Member

asvetlov commented Nov 7, 2016

Thanks

asvetlov pushed a commit that referenced this pull request Nov 7, 2016
Mongo ids are useful as a named resource in a route, but they are usually named `_id` and are excluded by the current regex
@arthurdarcet
Copy link
Contributor Author

Thanks, and good to know for the non-ascii names. I'll have a go a that too if I ever need it

For reference, if anyone stumble here, python identifiers are:

identifier   ::=  xid_start xid_continue*
id_start     ::=  <all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl, the underscore, and characters with the Other_ID_Start property>
id_continue  ::=  <all characters in id_start, plus characters in the categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property>
xid_start    ::=  <all characters in id_start whose NFKC normalization is in "id_start xid_continue*">
xid_continue ::=  <all characters in id_continue whose NFKC normalization is in "id_continue*">

@arthurdarcet arthurdarcet deleted the undescore_resources branch November 7, 2016 15:01
@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants