Re: Memory usage in Python?
Thats exactly what I was recommending, I just wanted him to search a bit for himself . I however would consider backing that operator up with some type checking, or at least exception checking (just following the etafftp pattern), cause otherwise the whole thing would crash down in flames if you throw something in there that doesn't have a name attribute, and since you put the self.name == other.name evaluation first, it will even crash when comparing to strings. I'd consider something like that in Python 3:
def __eq__(self, other):
if isinstance(other, str):
return self.name == other
elif isinstance(other, map):
return self.name == other.name
return NotImplemented
Best Regards.
Hijacker
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector