Suppose I have a class with a string instance attribute. Should I initialize this attribute with \"\" value or None? Is either
For lists or dicts, the answer is more clear, according to http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#default-parameter-values use None as default parameter.
But also for strings, a (empty) string object is instanciated at runtime for the keyword parameter.
The cleanest way is probably:
def myfunc(self, my_string=None):
self.my_string = my_string or "" # or a if-else-branch, ...