Jul-22-2019, 05:44 AM
hi everyone,
My questions is follows
lets say i have
Here is the tricky part, my list of attributes let say has less items..
2. how can i skip the att_3_data (leave default as None as you see att_3_data is missing from list) and continue to next attr_4_data
I guess somehow i need to use keyword argument..
hope I was able to describe the problem
THANKS
My questions is follows
lets say i have
class BaseClass: def __init__(self, atr_1=None, atr_2=None, atr_3=None): passI want to create class instance by passing attributes in the list.
Here is the tricky part, my list of attributes let say has less items..
a_list = ["att_1_data", "att_2_data", "att_4_data"]1. how i can pass this list of attributes without iterating over list items
2. how can i skip the att_3_data (leave default as None as you see att_3_data is missing from list) and continue to next attr_4_data
I guess somehow i need to use keyword argument..
hope I was able to describe the problem
THANKS