System Information
OpenCV python: opencv-python-headless==4.8.0.74
Operating System / Platform: 10.0.19045 Build 19045
Python version: 3.9.13
Detailed description
cv2.__all__ and cv2.__version__ are missing from the stubs.
cv2.__version__ is useful for compatibility checks.
cv2.__all__ is important for type checkers to know which symbols are.
Without __all__ specified:

With __all__ = [] specified:

Runtime:
>>> from cv2 import *
>>> SORT_EVERY_ROW
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'SORT_EVERY_ROW' is not defined
Steps to reproduce
>>> import cv2
>>> [x for x in dir(cv2) if x.startswith("__") and x.endswith("__")]
['__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__']
import cv2
cv2.__all__ # "__all__" is not a known member of module "cv2"
cv2.__builtins__
cv2.__cached__
cv2.__doc__
cv2.__file__
cv2.__loader__
cv2.__name__
cv2.__package__
cv2.__path__
cv2.__spec__
cv2.__version__ # "__version__" is not a known member of module "cv2"
Issue submission checklist
System Information
OpenCV python: opencv-python-headless==4.8.0.74
Operating System / Platform: 10.0.19045 Build 19045
Python version: 3.9.13
Detailed description
cv2.__all__andcv2.__version__are missing from the stubs.cv2.__version__is useful for compatibility checks.cv2.__all__is important for type checkers to know which symbols are.Without

__all__specified:With

__all__ = []specified:Runtime:
Steps to reproduce
Issue submission checklist