Skip to content

Type stubs: cv2.Error is missing ALL_CAPS constants #23776

@Avasam

Description

@Avasam

System Information

OpenCV python: opencv_python_headless-4.7.0+772599a-cp37-abi3-win_amd64.whl
Operating System / Platform: 10.0.19045 Build 19045
Python version: 3.9.13

Detailed description

cv2.Error is missing ALL_CAPS constants, which is the norm for python constants/Final, and do exists at runtime. See steps below for an example.

It's likely other modules are also missing their ALL_CAPS variants, I've only noticed cv2.Error because I'm using it.

Steps to reproduce

import cv2.Error

cv2.Error.STS_ERROR # "STS_ERROR" is not a known member of module "cv2.Error" Pylance(reportGeneralTypeIssues)

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions