GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [MNT]: Remove backend state handling from rcParams · Issue #31791 · matplotlib/matplotlib

[MNT]: Remove backend state handling from rcParams #31791

New issue
Copy link
New issue
Copy link
Open
Open
[MNT]: Remove backend state handling from rcParams#31791
Copy link
Labels
Maintenance

Description

@timhoffm
timhoffm
opened on May 31, 2026
Issue body actions

Summary

Following up on #26406 (comment)

rcParams should be only configuration, not state; i.e. wrt. backend, it can hold the desired backend and backend priorities, but it should not hold the currently active backend or trigger backend selection as a side-effect. The latter causes a lot of complexity in rcParams, which is responsible for the failed attempt to deprecate rcParams._get("backend") (#30963) as a lot of internal logic depends on it.

Proposed fix

We should remove backend state handling from rcParams. Due to the internal complexity and API that is used both internally and public, the migration is complicated. I propose a multi-step approach:

  • (1) Make the backend a RcParams class attribute and do not hold "backend" as a regular dict entry. There can only be one backend, so putting that value in a class attribute RcParams._backend makes sense. This already reduces the complexity as we don't need special handling to sync/copy the value when rcParams are bulk-replaced (loading from file or rc_context). Instead add special logic to keep behavioral backward compatibility with the dict API (rcParams["backend"] / rcParams._get("backend"), "rcParams._set("backend", val)).
    MNT: Move "backend" from a regular rcParams dict entry to a class attribute #31792
  • (2) Move all internal backend logic to not go through the official rcParams dict API anymore.
    MNT: Remove internal usage of the 'backend' key in rcParams #32495
  • (3) Deprecate the rcParams dict API for "backend"; if needed add more
  • (4) Move the backend state from RcParams._backend away from RcParams, and either into pyplot or into top-level matplotlib. - Possibly only after the deprecation has expired.

The motivation is that deprecation (3) is very difficult (see #30963) as long as we use the API internally, so we first need to change our internal usage (2), which requires a state that is easily accessible without the dict API (1).

Activity

  1. timhoffm
    added
    Maintenance
    on May 31, 2026
  2. timhoffm
    added 3 commits that reference this issue on May 31, 2026

    MNT: Move "backend" from a regular rcParams dict entry to a class att…

    1639484

    MNT: Move "backend" from a regular rcParams dict entry to a class att…

    85159ce

    MNT: Move "backend" from a regular rcParams dict entry to a class att…

    8b8563d
  3. timhoffm
    added a commit that references this issue on Jul 29, 2026

    MNT: Move "backend" from a regular rcParams dict entry to a class att…

    540d1a4
  4. timhoffm
    added a commit that references this issue on Oct 16, 2026

    MNT: Move "backend" from a regular rcParams dict entry to a class att…

    df49f80
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

    Maintenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.