Skip to content
Advertisement

How to compare components versions and find the latest ones in python list of dict?

I have a simple list of components dict to install.

JavaScript

Components may be the same, but have different versions. I want to get a list of components with latest versions. So, expecting result is

JavaScript

What is the best way to compare component to each other? I tried to solve it using bash, but it looks like crap, so I want to make it more readable using python.

Advertisement

Answer

One line. Works with multilevel versions (1.2.4.7…)

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement