friedererdmann / pymxs_stubs

Stubs and stub generator for PyMXS
MIT License
35 stars 5 forks source link

Clean up discarding invalid class and attribute names #7

Closed friedererdmann closed 2 years ago

friedererdmann commented 2 years ago

Currently checking for invalid class and attribute names happens in at least two different places and makes no use of any good logic. See if there's an easy regex or similar to sort out illegal names (starting with digit or special character) as well as discarding any attributes and class names that double with Python internal reserved words.

friedererdmann commented 2 years ago

Fixed in 0de562afe81eb2849f06898e8e49d18e28d35418 - now using keyword.iskeyword() and str.isidentifier() to check names. Also moved code closer together.