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

[Pythagorean Triplet]: PEP-8 Refactor of Approaches introduction.md File #3832

Closed
wants to merge 1 commit into from

Conversation

Ryrden
Copy link
Contributor

@Ryrden Ryrden commented Nov 29, 2024

When I faced this code, It was very hard to read, so I've refactored it following Python PEP recommendations

Here is all guidelines I've followed:

@BethanyG
Copy link
Member

BethanyG commented Nov 29, 2024

Hi @Ryrden 👋🏽

Thanks for submitting this. However, this approach was written by someone who was very careful to format the code in a specific fashion. PEP-8 states (emphasis mine):

A Foolish Consistency is the Hobgoblin of Little Minds
...
A style guide is about consistency. Consistency with this style guide is important. Consistency within a project is more important. Consistency within one module or function is the most important.

However, know when to be inconsistent – sometimes style guide recommendations just aren’t applicable. When in doubt, use your best judgment. Look at other examples and decide what looks best.

And while PEP 8 does say line length of 79, we adhere to a line length of 120 to avoid onerous and excessive file length and line breaks. We also make extensive use of implicit concatenation within comprehensions and generator expressions. That is why the code is broken up the way it is.

Finally, there are times where we format code examples to prevent horizontal scrolling on the website. I don't know for sure, but that might be the case here.

I am sorry that this was difficult for you to read, but (for now - we may revisit in the future) we want to keep the file as-is.

@BethanyG BethanyG closed this Nov 29, 2024
@Ryrden
Copy link
Contributor Author

Ryrden commented Nov 29, 2024

Never mind, Thanks for the feedback!

@Ryrden Ryrden deleted the patch-1 branch November 29, 2024 23:49
@BethanyG BethanyG changed the title PEP refactor [Pythagorean Triplet]: PEP-8 Refactor of Approaches introduction.md File Nov 29, 2024
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.

2 participants