Skip to content

More consistent handling of 'None' vs. 'none' #19300

@timhoffm

Description

@timhoffm

Summary

The strings 'None' vs 'none' are not handled consistently:

  • At least MarkerStyle only accepts 'None' (xref Cleanup code for format processing #19291 (comment)). - Maybe other places too.
  • However, in many places we accept both 'None', 'none' (and sometimes also other capitalizations).
  • Counting occurences, we have 777 'none' and 139 'None' in our code base.

Proposed fix

Aim at making the API more consistent by:

  • Choose one version and use it whenever possible throughout code, docs and examples.
    • I propose to choose 'none' because most other named strings are lowercase. And it's a step further away from None, which may help making it more clear that those two are different.
  • Make all other places accept that version too.
  • For now do not deprecate other writings or conversions. If a way of writing is working now, there'll be lots of code out there using it. It's not worth breaking that.

Note @brunobeltran You might stumble over these inconsistencies when formalizing types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …MaintenancekeepItems to be ignored by the “Stale” Github Action

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions