Python中max()函数的尊重参数

时间:2015-09-09 10:49:30

标签: python

我有这段代码:

def find_smallest_circle_sqtime(list):
    inv_number_of_elements = 1.0 / len(list);
    smallest_circle = MyCircle(inv_number_of_elements * sum(p.get_x() for p in list),
                               inv_number_of_elements * sum(p.get_y() for p in list), .1);

    smallest_circle.radius = max(smallest_circle.centre.sub(p).norm() for p in list);
    return smallest_circle

我在list相对于smallest_circle.centre获得最远点的半径。但实际上我需要弄清楚这一点。我怎样才能以最蟒蛇的方式做到这一点?

0 个答案:

没有答案