PEP8 decimal space

I review the code and see these method declarations:

def __init__(self,data): 

I always thought that it should be formatted as follows:

 def __init__(self, data): 

But then I checked PEP 0008 and I don’t see the exact statement about it. There is guidance on spaces around operators and inside parentheses, but not about a comma-separated list.

If this is not described in PEP8, is there perhaps some unwritten convention about this? Why was I convinced it was in PEP8? Shoud PEP8 will be updated?

+8
python coding-style pep8
source share
1 answer

I also cannot find the corresponding sentence in PEP8, but I think the reason why most people believe that this rule is in PEP8, pip pep8 .

In accordance with their:

E231 missing a space after ',

Since most people use this as their style check, it's easy to make sure that the rule is indeed in PEP8.

+5
source share

All Articles