Skip to content

Add easily comparable version info to toplevel #18312

Closed

Description

@anntzer

Problem

Currently matplotlib only exposes __version__. For quick version checks, exposing either a version_info tuple (which can be compared with other tuples) or a LooseVersion instance (which can be properly compared with other strings) would be a small usability improvement.

(In practice I guess boring string comparisons will work just fine until we hit mpl 3.10 or 4.10 which is unlikely to happen soon, but that feels quite dirty :))

Proposed Solution

I guess I slightly prefer LooseVersion, but exposing just a version_info tuple is much more common in other packages (and perhaps simpler to understand). The hardest(?) part is probably just bikeshedding this point :-)

Additional context and prior art

version_info is a pretty common thing (citation needed).

Activity

  1. timhoffm commented on Nov 1, 2020

    @timhoffm
    Member

    It seems that __version_info__ is the way to go.

    Prior art

  2. added this to the v3.4.0 milestone on Nov 17, 2020
  3. modified the milestones: v3.4.0, v3.5.0 on Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions