Top "Pep" questions

Python Enhancement Proposals are used to propose and document Python language features, development processes and best practices.

Why is there no xrange function in Python3?

Recently I started using Python3 and it's lack of xrange hurts. Simple example: 1) Python2: from time import time as t …

python python-3.x pep xrange
What's the function like sum() but for multiplication? product()?

Python's sum() function returns the sum of numbers in an iterable. sum([3,4,5]) == 3 + 4 + 5 == 12 I'm looking for the function that returns the …

python product built-in pep
E731 do not assign a lambda expression, use a def

I get this pep8 warning whenever I use lambda expressions. Are lambda expressions not recommended? If not why?

python lambda pep
Triple-double quote v.s. Double quote

What is the preferred way to write Python doc string? """ or " In the book Dive Into Python, the author provides …

python pep8 quote docstring pep
Python PEP: blank line after function definition?

I can't find any PEP reference to this detail. There has to be a blank line after function definition? Should …

python coding-style styles pep
What PEP 8 guidelines do you ignore, and which ones do you stick to?

Over the years, the more Python I write, the more I find myself agreeing with most of the guidelines, though …

python pep8 pep
Python PEP 8: Blank lines at the beginning of a module

There is a question who treat about this but not talk about all the points I interested. PEP 8 says about …

python coding-style pep8 pep
Data Classes vs typing.NamedTuple primary use cases

Long story short PEP-557 introduced data classes into Python standard library, that basically can fill the same role as collections.…

python namedtuple pep python-3.7 python-dataclasses
Assignment with line continuation - Python

What is the preferred style for assigning values to variables when the variables are nested several levels deep, have fairly …

python styling pep