Keyword Functions
keyword.issoftkeyword()
Test whether a spelling has context-sensitive keyword status. A soft keyword can still be an identifier outside its special grammar context.
Formal Syntax & Structure
python syntaxpython
keyword.issoftkeyword(s, /)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| s | str | Candidate identifier spelling. |
Return Value
bool
The bool result described above.
Working Example
Example Snippetpython
import keywordprint(keyword.issoftkeyword("match"), keyword.issoftkeyword("class"))