Flag Enum OR-ing gets flagged as not supported #726
Labels
bug
Something isn't working
fixed in next version (main)
A fix has been implemented and will appear in an upcoming version
Environment data
"python.analysis.typeCheckingMode": "strict"
Expected behaviour
Python Flag enums support setting an enum to the combination of other already defined enums using the
|
(OR) operator. This behaviour is shown in the documentation.Pylance should not be flagging this as unsupported and marking the resulting value as an
Unknown
type. The resulting type should be along the lines ofLiteral[PinMode.INPUT | PinMode.OUTPUT]
orLiteral[PinMode[INPUT | OUTPUT]]
(I think).Actual behaviour
Pylance reports an error
reportGeneralTypeIssues
when using the|
(OR) operator on flag type enums.Code Snippet / Additional information
The text was updated successfully, but these errors were encountered: