Petri Lehtinen added the comment: Sounds like a bug to me.
It's not too straightforward to fix, though. The order of MIME types is lost because they are stored as keys of a dict. AFAICS, it wouldn't help to use OrderedDict and checking for the wildcard type first if its index is smaller. Example: image/*; foo %s; test=/bin/false image/jpeg; bar %s; test=/bin/true image/*; baz %s; test=/bin/true In this case, the image/jpeg entry should be returned, but both image/* entries get grouped together, so they would be evaluated first and the "baz %s" entry would be returned. The API expects the result of getcaps() (a dict) to be passed to findmatch(), which makes it very hard to change the caps representation. The only way I can think of would be to change the representation to a dict subclass with extra semantics. Plain dict would still have to be supported for backwards compatibility, though. ---------- nosy: +petri.lehtinen _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14977> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com