Fix invalid enums
The following enums are invalid. Please change the attribute names to valid identifiers. https://github.com/bruderstein/PythonScript/blob/52f7d7b3745ebd629ff4549365b13aac4c813c95/docs/source/enums.rst?plain=1#L1349 https://github.com/bruderstein/PythonScript/blob/52f7d7b3745ebd629ff4549365b13aac4c813c95/docs/source/enums.rst?plain=1#L1351 https://github.com/bruderstein/PythonScript/blob/52f7d7b3745ebd629ff4549365b13aac4c813c95/docs/source/enums.rst?plain=1#L1587
Why do you think they are invalid? They are created from the header, they might be outdated, but ... invalid?
Why do you think they are invalid? They are created from the header, they might be outdated, but ... invalid?
In the header the enums are prefixed with WV_, making them valid identifiers. However, names cannot start with a number according to the docs. We can use str.isidentifier method to see if a string is a valid identifier.
>>> WINVER.WIN10.name
'WIN10'
>>> WINVER.95.name
File "<console>", line 1
WINVER.95.name
^^^
SyntaxError: invalid syntax
>>> [name for name in WINVER.names if not name.isidentifier()]
['95', '98']
I see, thanks for the clarification.