Open3D type checking bug/issue

I opened an issue on GitHub for this topic but because I am not sure if it is a bug or if I’m doing something wrong, I wanted to open the same topic here on the forum as well.

Describe the bug
Since the Open3D update I get this kind of a warning (see screenshots on GitHub, because I can’t upload more than one image as a new user: https://github.com/intel-isl/Open3D/issues/3052) in PyCharm when I try to add a point cloud as a geometry in a visualizer.

I’ve also seen issues like “Expected type ‘PointCloud.py’, got ‘PointCloud’ instead”, where the only difference is that the expected type is the type of the object I am already giving but followed by a “.py”

To Reproduce

  1. Start PyCharm
  2. Write a test program that uses the geometry, or pointcloud objects (even some others)
  3. Create an object of some of those types, but explicitly define the type, i.e.:
    some_pointcloud: open3d.geometry.PointCloud = open3d.geometry.PointCloud() (added another screenshot for this example)
  4. Give it as an input to the method that uses such object

Expected behavior
The method should accept the input object and PyCharm shouldn’t complain about it.

Screenshots

Environment (please complete the following information):

  • Operating system: Windows 10 64-bit
  • Python version: Python 3.8 (but it happens in other Python versions I believe)
  • Open3D version: Open3D 12 (but I think it also happened in 11, not 100% sure though)
  • Is this remote workstation?: no
  • How did you install Open3D?: pip (through PyCharm)
  • Compiler version (if built from source): n/a

Additional context
I opened this discussion on Discord, but there were no responses, so I assume that it is a bug. Also, in the geometry issue, I’ve tried casting it to a geometry object type, but there were some issues with the geometry object constructor. I searched the documentation to try and see if I’m doing something wrong, but I couldn’t find anything specific to this.

By the way, nothing crashes, everything works as intended, it’s just these silly warnings that the static code analyzer complains about.