根据PEP8的字典中的长线

问题描述 投票:0回答:1

我的字典中有长行(> 79),如下所示:

context = {
    "this_is_long_key_from_db": mydict['this_is_long_key_from_db']
}

我如何根据PEP8正确分割它?我找不到有关此案的答案。

python python-3.x coding-style pep8
1个回答
0
投票

长行是> 79个字符,因此您的示例是正确的。但是,我已经使用http://pep8online.com/checkresult测试了此代码,但没有收到错误:

context = {
    "this_is_long_key_from_long_database_name":
        mydict['this_is_long_key_from_long_database_name']
}
© www.soinside.com 2019 - 2024. All rights reserved.