Guido van Rossum wrote: > "Containerish" behavior isn't enough to warrant empty <--> false; in > some sense every object is a container (at least every object with a > __dict__ attribute) and you sure don't want to map __len__ to > self.__dict__.__len__... the ElementTree experience shows that doing def __getitem__(self, index): return self.items[index] def __len__(self): return len(self.items) def __nonzero__(self): return True is sometimes a good idea, even for objects that are mostly sequences. (ET 1.2.X lacks the __nonzero__ method, and accidentally treating elements with no subelements as if the element itself doesn't exist is by far the most common gotcha in ET code). </F>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4