Closed
Description
🐞 Describe the bug
This code is rejected with 'Incorrect route name':
@app_routes.get('/result/', name='check-for-result')
async def result(request):This is because 'for' is a keyword, and the check rejects any keywords for some strange reason:
in https://github.com/aio-libs/aiohttp/blob/master/aiohttp/web_urldispatcher.py#L982
parts = self.NAME_SPLIT_RE.split(name)
for part in parts:
if not part.isidentifier() or keyword.iskeyword(part):
raise ValueErrorI think the intention was to have:
if not (part.isidentifier() or keyword.iskeyword(part))💡 To Reproduce
💡 Expected behavior
Should accept route names containing python keywords
📋 Logs/tracebacks
📋 Your version of the Python
$ python --version
Python 3.7.4📋 Your version of the aiohttp/yarl/multidict distributions
$ python -m pip show aiohttp
Version: 3.6.2$ python -m pip show multidict
Version: 4.7.5$ python -m pip show yarl
Version: 1.3.0📋 Additional context