nvda
d4586a5d - Ensure states/roles are unique (PR #13414)

Commit
3 years ago
Ensure states/roles are unique (PR #13414) Values in the State/Role enums are getting large, it is easy for a developer to accidentally duplicate a value. NVDA states were initially defined as powers of 2 so that the states property on NVDAObject could return multiple (bit flag) values within an integer. However, for a long time now, the states property returns a Python set. The values no longer have to set a unique bit. Also, now that Role/State constants are enums, we no longer depend on manually matching values printed in logging with the values in the file (because enums are named). Change: - Decorate Role/State enum classes with unique. - Prevent errors manually assigning a value by using auto.
Author
Parents
Loading