This validation checks if string is a proper name for a python variable.
Fixes Or Enhances
Sometimes we may use our code to call external binaries, or even to construct what are effectively scripts.
Python is relatively loose, but it does enforce rules about variable names rather vehemently.
Specifically they must be generated by a specific grammar, and they must not be keywords[0].
The same restriction applies to ansible variables. So this validation may also be useful when one is constructing data structures intended to be used by ansible.
Make sure that you've checked the boxes below before you submit PR:
[x] Tests exist or have been written that cover this particular change.
coverage: 73.918% (+0.02%) from 73.903%
when pulling ade0b7f2dee1164f1f25fd328d36a30414c3a3ec on jpodivin:python
into 84254aeb5a59e615ec0b66ab53b988bc0677f55e on go-playground:master.
This validation checks if string is a proper name for a python variable.
Fixes Or Enhances
Sometimes we may use our code to call external binaries, or even to construct what are effectively scripts. Python is relatively loose, but it does enforce rules about variable names rather vehemently. Specifically they must be generated by a specific grammar, and they must not be keywords[0].
The same restriction applies to ansible variables. So this validation may also be useful when one is constructing data structures intended to be used by ansible.
Make sure that you've checked the boxes below before you submit PR:
@go-playground/validator-maintainers
[0] https://docs.python.org/3/reference/lexical_analysis.html#identifiers