Skip to content

[MNT]: macOS backend uses un-prefixed class names #31813

@iccir

Description

@iccir

Summary

Currently, the macOS backend defines the following four Objective-C classes:

Name Superclass Python Owner
Window NSWindow FigureManager
View NSView FigureCanvas
MatplotlibAppDelegate NSObject -
NavigationToolbar2Handler NSObject NavigationToolbar2

Officially, per Apple Conventions: "your own classes should use three-letter prefixes".

In practice, un-prefixed names like "Window" or "View" are commonly used inside of application code. Inside of framework code, however, they would cause naming conflicts.

The macOS matplotlib backend is an unusual hybrid of a Python framework that then masquerades as an app. As such, it probably makes sense to prefix our classes (either with a standard three-letter abbreviation like MPL or with a full-name prefix like "Matplotlib").

That said, the un-prefixed names seemingly haven't conflicted with anything in over a decade.

Opinions?

Proposed fix

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions