I am reminded of carpaski's 'lists as sets' chatting in IRC :) portage_py has a match_to_list function, however it was not qualified with a 'portage_util.' like it should have been. match_to_list is declared and defined in portage_util.py. However, match_to_list depends on match_from_list which is declared and defined in portage.py. This behavior seems odd since the functions appear to do similar things. Regardless, I've patched the required files and no longer get odd output. However, please check over the patches to insure I didn't misinterpret the code.
Created attachment 52850 [details, diff] fixes errors in portage.py
Created attachment 52851 [details, diff] portage_util
I believe this is fixed,or the code moved, or something ;)