Python PEP-8:E122 和 E501 之后的分配
Python PEP-8: Assignment following E122 and E501
在如下情况下,如何改进多变量或长变量的赋值以遵循规则E122和E501:
def my_example_function():
return 1, 2, 3, 4
# How can I improve the following line:
first_variable, second_variable, third_variable, fourth_variable = my_example_function()
只需跨越多行..
( first_variable, second_variable,
third_variable, fourth_variable ) = my_example_function()
first_variable, second_variable, third_variable, fourth_variable = \
my_example_function()
在如下情况下,如何改进多变量或长变量的赋值以遵循规则E122和E501:
def my_example_function():
return 1, 2, 3, 4
# How can I improve the following line:
first_variable, second_variable, third_variable, fourth_variable = my_example_function()
只需跨越多行..
( first_variable, second_variable,
third_variable, fourth_variable ) = my_example_function()
first_variable, second_variable, third_variable, fourth_variable = \
my_example_function()