Conversation
|
If this fixes the issue, then I'm happy to go ahead. However:
From: https://peps.python.org/pep-0544/#changes-in-the-typing-module
I'd like to understand why this causes the error, I'll take a further look at that next. |
feerrenrut
left a comment
There was a problem hiding this comment.
Although I'd like to understand how this affects:
>>>import collections.abc
>>>isinstance(12, collections.abc.Sized)This code is only intended to support type checking / dev tools.
My only remaining concern is if we don't understand the cause of failure, we can't be sure there aren't other situations affected by this.
See test results for failed build of commit 9aff7831b1 |
See test results for failed build of commit 711b2dc3b0 |
See test results for failed build of commit cdad9d03cd |
See test results for failed build of commit cdad9d03cd |
See test results for failed build of commit cdad9d03cd |
See test results for failed build of commit cdad9d03cd |
Link to issue number:
Fixes #13923
Summary of the issue:
Performing type checks for collections fail
The following code raises an error when FlagValueEnum is defined as
In the NVDA python console
Description of user facing changes
API is fixed for performing type checks in
collections.Description of development approach
Removing
typing.Collectionorenum.EnumMetafrom the MRO both resolve the python console / API bug.As a result, I assume the bug is some sort of class conflict between
typing.Collectionandenum.EnumMeta.We could resolve this by creating a metaclass.
However, I believe the already included EnumMeta class should cover what we wanted in type hinting
typing.Collection.https://docs.python.org/3/library/enum.html#enum-classes.
Testing strategy:
Tested with add-on and python console.
Known issues with pull request:
None
Change log entries:
Unreleased regressions
Code Review Checklist: