When I'm creating a new class, if one of my attribute is an empty list, pychram suggest to change it to this:
class meet_angle_cond:
def __init__(self, xy_lat_lon_list=None):
if xy_lat_lon_list is None:
xy_lat_lon_list = []
self.xy_lat_lon_list = xy_lat_lon_list
I'm struggling to understand why this is better than:
class meet_angle_cond:
def __init__(self, xy_lat_lon_list=[]):
self.xy_lat_lon_list = xy_lat_lon_list
It seems to me that this way is more effective and readable.