Suppose I have a class with a string instance attribute. Should I initialize this attribute with "" value or None? Is either okay?
def __init__(self, mystr="")
self.mystr = mystr
or
def __init__(self, mystr=None)
self.mystr = mystr
Edit: What I thought is that if I use "" as an initial value, I "declare" a variable to be of string type. And then I won't be able to assign any other type to it later. Am I right?
Edit: I think it's important to note here, that my suggestion was WRONG. And there is no problem to assign another type to a variable. I liked a comment of S.Lott: "Since nothing in Python is "declared", you're not thinking about this the right way."