I have this section in my code:
class CSVFile():
# Keys in kwargs that are not allowed
__black_list = ()
def __init__(self, **kwargs):
for (k, v) in kwargs.iteritems():
if k in self.__class__.__black_list:
LOG.error("%s is not allowed ", k)
setattr(self, k, v)
As you can see I'm assigning key=>value
pairs as instance variables. Later on in the code I'm using the variables I set here (ex. self.dest
).
And when I check it with pylint
it complains :
E: 54,32:CSVFile.upload_file_to_s3: Instance of 'CSVFile' has no 'dest' member
Obviously if I would define self.dest
in __init__
method, then this error would go away.
So the question is: Is this code looks "bad" from PEP8 perspective?