Skip to content

Inconsistency between " and ' in the code #8079

Closed

Description

@Naereen

Hi,
That's not a bug per say, but I noticed a strong inconsistency in the codebase between strings with simple and double quotes.
For instance, see that line (def hist in _axes.py):

@_preprocess_data(replace_names=["x", 'weights'], label_namer="x")

I don't think there is a semantic reason for this difference between "x" and 'weights' (if there is, it's not clear).

If a maintainer thinks this should be corrected, I think a carefully designed regexp and sed command line can do the job quickly.

Activity

  1. tacaswell commented on Feb 15, 2017

    @tacaswell
    Member

    The inconsistency is not great, but basically harmless.

    I am deeply skeptical of massive automated changes like this. We do not have 100% test coverage so it may introduce bugs we miss on review, they are hard to review (do to large number of almost trivial changes), and I do not see much of a pay-off on this.

    In some cases the ' or " as the outer quote is to due to wanting to use the other one inside which may pose some difficulty with the regex.

  2. WeatherGod commented on Feb 15, 2017

    @WeatherGod
    Member
  3. Naereen commented on Feb 15, 2017

    @Naereen
    Author

    I agree it should not be made automatic, and not be enforced.

    But maybe it could at least be fixed in the actual codebase?
    It feels weird to see both "..." and '...' on the same line.

  4. dopplershift commented on Feb 15, 2017

    @dopplershift
    Contributor

    I like enforcing the consistency (by which I mean ') in my own project--I would not go back and make a massive change to matplotlib.

    If for some reason we were to want to enforce this, there's the flake-quotes plugin for flake8, which we could run with pytest-flake8.

  5. Naereen commented on Feb 15, 2017

    @Naereen
    Author

    @dopplershift Great, I wasn't aware of that plugin.

    OK for not brutally changing anything.

  6. anntzer commented on Apr 15, 2017

    @anntzer
    Contributor

    It looks like the agreement is to close the issue.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions