I have the following problem :
I have a list of tuple representing packages and their version (some packages don't have a specified version so no problem with that) like so :
('lib32c-dev', '', '', '')
('libc6-i386', '2.4', '', '')
('lib32c-dev', '', '', '')
('libc6-i386', '1.06', '', '')
('libc6-i386', '2.4', '', '')
('lib32c-dev', '', '', '')
('libc6-i386', '2.16', '', '')
('libc6-dev', '', '', '')
('', '', 'libc-dev', '')
('libc6-dev', '', '', '')
('', '', 'libc-dev', '')
('libncurses5-dev', '5.9+20150516-2ubuntu1', '', '')
('libc6-dev-x32', '', '', '')
('libc6-x32', '2.16', '', '')
('libncursesw5-dev', '5.9+20150516-2ubuntu1', '', '')
('libc6-dev-x32', '', '', '')
('libc6-x32', '2.16', '', '')
('libc6-dev-x32', '', '', '')
('libc6-x32', '2.16', '', '')
('libncurses5-dev', '5.9+20150516-2ubuntu1', '', '')
('libncursesw5-dev', '5.9+20150516-2ubuntu1', '', '')
As you can see, some packages are listed in tuples more than once but with a different version.
What I need is to parse the list of tuple in order to have for each package the most recent version before transforming the list into a dictionary.
PS : The position of the package name and it's version are not fixed. But we can say that the version is always after the package name so can we say that the version will always be at position 1 and 3 ?
Thank you for your help.