8000 small bug in documentation of backend.FigureCanvasBase.start_event_loop · Issue #17615 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
small bug in documentation of backend.FigureCanvasBase.start_event_loop #17615
Closed
@hernot

Description

@hernot

Bug report

The docstring of FigureCanvasBase.start_event_loop and thus also the manual page states that

If timeout is negative, never timeout.
But when reading the code by following the code link on the matplotlib manualpage for FigureCanvasBase. It schoud read

If timeout <= 0 never time out

Which is the actual behaviour when setting timout to 0.

Compare to actual implementation displayed when following code link

       if timeout <= 0:
            timeout = np.inf
        timestep = 0.01
        counter = 0
        self._looping = True
        while self._looping and counter * timestep < timeout:
            self.flush_events()
            time.sleep(timestep)
            counter += 1

Matplotlib version

  • Operating system:
  • Matplotlib version:
  • Matplotlib backend (print(matplotlib.get_backend())):
  • Python version:
  • Jupyter version (if applicable):
  • Other libraries:

Verified on Mtaplotlib 2.2.1 but as given incongruency between documentation and code also persits on current github master branch it likely also affects newer releases on all backends and operating systems if not overridden by backend specific start_event_loop implementations .

Not relevant for incongruency between actual, correct and expected code behaviour and documentation.

No

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0