Type checking breaks on Enum private name mangling #7619
Labels
addressed in next version
Issue is fixed and will appear in next published version
bug
Something isn't working
Type: Bug
According to the enum library docs, since Python 3.11 any attribute in an Enum with a private/mangled name will not be converted into an Enum object but will be left as an attribute. In my Python 3.12.2 interpreter, this works as expected. However, Pylance still thinks that its type will be Literal. An example where this happens looks like this:
The error produced is as follows:
Extension version: 2024.4.1
VS Code version: Code 1.87.2 (Universal) (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:21:31.043Z)
OS version: Darwin arm64 23.4.0
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: