Skip to content

1.1.410 detects type as module #11481

Closed
Closed

Description

@bersbersbers

Describe the bug
1.1.410:

bug.py
  bug.py:5:7 - error: Module cannot be used as a type (reportGeneralTypeIssues)
  bug.py:5:19 - error: Module is not callable (reportCallIssue)
  bug.py:6:13 - information: Type of "ImageView" is "Module(".ImageView")"
2 errors, 0 warnings, 1 information

1.1.409:

bug.py
  bug.py:6:13 - information: Type of "ImageView" is "type[ImageView]"
0 errors, 0 warnings, 1 information

Code or Screenshots

from typing import reveal_type

from pyqtgraph import ImageView

view: ImageView = ImageView()
reveal_type(ImageView)
pyqtgraph==0.14.0

VS Code extension or command-line
running pyright 1.1.410 as a command-line tool via pyright-python.

Activity

  1. added
    bug
    on Jun 8, 2026
  2. rchiodo commented on Jun 8, 2026

    @rchiodo
    Collaborator

    ImageView seems to be both a module and a class name. Not sure why we're treating it as a module now though.

  3. rchiodo commented on Jun 8, 2026

    @rchiodo
    Collaborator

    This would be a temporary workaround:

    from pyqtgraph.imageview import ImageView
  4. rgoya commented on Jun 19, 2026

    @rgoya

    I'm seeing this too on code that uses dash-bootstrap-components. For example, the following code:

    from typing import reveal_type
    import dash_bootstrap_components as dbc  # version 2.0.4
    
    dbc.Row()
    
    reveal_type(dbc.Row)  # Runtime type is 'ComponentMeta'

    1.1.409 reports:

    {...}/test.py:6:13 - information: Type of "dbc.Row" is "type[Row]"
    

    but 1.1.410 reports:

    {...}/test.py:4:1 - error: Module is not callable (reportCallIssue)
    {...}/test.py:6:13 - information: Type of "dbc.Row" is "Module(".Row")"
    
  5. bersbersbers commented on Jun 25, 2026

    @bersbersbers
    Author

    This would be a temporary workaround:

    from pyqtgraph.imageview import ImageView

    Thanks! I have a similar problem with

    from typing import reveal_type
    
    from pyqtgraph import PlotItem
    
    view: PlotItem = PlotItem()
    reveal_type(PlotItem)

    yet a similar workaround is not effective:

    from typing import reveal_type
    
    from pyqtgraph.graphicsItems import PlotItem
    
    view: PlotItem = PlotItem()
    reveal_type(PlotItem)

    gives

    bug.py:5:7 - error: Module cannot be used as a type (reportGeneralTypeIssues)
    bug.py:5:18 - error: Module is not callable (reportCallIssue)
    bug.py:6:13 - information: Type of "PlotItem" is "Module("pyqtgraph.graphicsItems.PlotItem")"
    
  6. eachimei commented on Jun 29, 2026

    @eachimei

    FYI, similar issue:

    • 1.1.409 - no problem
    • 1.1.410 - error: Module is not callable (reportCallIssue)
    • 1.1.411 - error: Module is not callable (reportCallIssue)
  7. added a commit that references this issue on Jun 29, 2026
    ffe1973
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions