The RM0367 (STM32L0x3) and RM0376 (STM32L0x2) say
The ... products integrate an MCU ID code. This ID identifies the ST MCU part number (sic) and the die revision.
But that is not true!
The Device IDs are the same for both STM32L0x3 parts and STM32L0x2 parts!
In fact, the Device ID just tells you whether it is a Cat-3 or Cat-5 device:
Both L073 and L072 are Cat-5 devices - both have Device ID 447;
Both L053 and L052 are Cat-3 devices - both have Device ID 417.
So: how can these device pairs be distinguished at run time?
The only difference seems to be the presence of the LCD controller on L0x3 (absent on L0x2) - so is there a way to detect the presence/absence of the LCD controller?