在带有参数列表和赋值的长行中,pep8 的正确缩进是什么
What is the correct indention for pep8 on long lines with argument list and assignment
这个场景的正确缩进是什么:
class StorageType(models.Model):
""" Defining a general typ of storage """
name = models.CharField(
max_length=50,
help_text=_("The name for a storage type. Should be unique")
)
pep8 抱怨
../models.py:68:13: E126 continuation line over-indented for hanging indent
../models.py:70:9: E121 continuation line under-indented for hanging indent
这是一个正确的缩进:
class StorageType(models.Model):
""" Defining a general typ of storage """
name = models.CharField(
max_length=50,
help_text=_("The name for a storage type. Should be unique")
)
我不知道 "correct one",但这是我最喜欢的,它通过了 pep8
检查:
name = models.CharField(
max_length=50,
help_text=_("The name for a storage type. Should be unique")
)
这个场景的正确缩进是什么:
class StorageType(models.Model):
""" Defining a general typ of storage """
name = models.CharField(
max_length=50,
help_text=_("The name for a storage type. Should be unique")
)
pep8 抱怨
../models.py:68:13: E126 continuation line over-indented for hanging indent
../models.py:70:9: E121 continuation line under-indented for hanging indent
这是一个正确的缩进:
class StorageType(models.Model):
""" Defining a general typ of storage """
name = models.CharField(
max_length=50,
help_text=_("The name for a storage type. Should be unique")
)
我不知道 "correct one",但这是我最喜欢的,它通过了 pep8
检查:
name = models.CharField(
max_length=50,
help_text=_("The name for a storage type. Should be unique")
)