I think mimetypes.guess_all_extensions() is broken in its return value when there are no matching extensions. Currently it returns None when there are no matching extensions[*], but I think it would be better to simply return an empty list. I have an application where I want to iterate over the return values, but I have to add a (IMO) useless hack: for ext in guess_all_extensions(mytype, strict=False) or []: # blah Seems like this would be a common use case. So what does returning None instead of an empty list buy you anyway? Since both are false, it should be fine to just remove the last two lines of the method. This method is new in Python 2.3 so I don't think backwards compatibility should be an issue. It's a simple fix; are there any objections? -Barry [*] The way the method returns None in the no-match case is bogus anyway. IMO, it shouldn't return None implicitly simply by virtue of falling off the end of the def.
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