Message313335
This is a minor nit, but the doc string for str.isidentifier() states:
Use keyword.iskeyword() to test for reserved identifiers such as "def" and "class".
At first glance, I thought that it meant you'd do this (doesn't work):
'def'.iskeyword()
As opposed to this:
import keyword
keyword.iskeyword('def')
Perhaps a clarification that "keyword" refers to the keyword module could be added. Or better yet, just make 'iskeyword()` a string method ;-). |
|
Date |
User |
Action |
Args |
2018-03-06 15:50:40 | dabeaz | set | recipients:
+ dabeaz, docs@python |
2018-03-06 15:50:40 | dabeaz | set | messageid: <1520351440.06.0.467229070634.issue33014@psf.upfronthosting.co.za> |
2018-03-06 15:50:40 | dabeaz | link | issue33014 messages |
2018-03-06 15:50:40 | dabeaz | create | |
|