Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP8 compliance on colors.py #1166

Merged
merged 3 commits into from Sep 10, 2012
Merged

PEP8 compliance on colors.py #1166

merged 3 commits into from Sep 10, 2012

Conversation

NelleV
Copy link
Member

@NelleV NelleV commented Aug 29, 2012

This is a new pull request on the pep8 compliance of colors.py, as asked by @pelson

'whitesmoke' : '#F5F5F5',
'yellow' : '#FFFF00',
'yellowgreen' : '#9ACD32',
'aliceblue': '#F0F8FF',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we will want to de-dent this dictionary literal, the former made it easier to scan the colour names and/or hex values.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the former is not pep8 :(

I'll update the PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hold fire until we get some other feedback then. If anyone else agrees with me then do it, if not, then its just me being picky ;-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact this is tolerated by pep8 and it is much nicer. i've updated the PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 2012/08/30 3:11 AM, Varoquaux wrote:

but the former is not pep8 :(

But it is. Quoting from
http://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds:

But most importantly: know when to be inconsistent -- sometimes the
style guide just doesn't apply. When in doubt, use your best judgment.
Look at other examples and decide what looks best. And don't hesitate to
ask!

Two good reasons to break a particular rule:

When applying the rule would make the code less readable, even for
someone who is used to reading code that follows the rules.

...

Eric

@pelson
Copy link
Member

pelson commented Aug 30, 2012

Apart from my first comment, +1

@travisbot
Copy link

This pull request fails (merged 6cdb75e2 into cf7618c).

@travisbot
Copy link

This pull request fails (merged 16f500bd into a7aaa83).


class ColorConverter:
class ColorConverter(object):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inheriting from object, while probably benign, will change behavior for those inheriting from these classes under Python 2.x. This should have an entry in docs/api/api_changes.rst.

@NelleV
Copy link
Member Author

NelleV commented Sep 7, 2012

I've rebased and added the inheritance in the api_changes doc

@mdboom mdboom merged commit dfd7b42 into matplotlib:master Sep 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants