AFAICT e39 is the same as e40.
Ex39 is an issue. E39 in an ex39 socket won' t contact the center so no light.
Ex39 in an e39 base will but may extend out more. There are other differences apparently.
EX39 Mogul Base The EX39 base has a longer tip base. EX39 based bulbs can be used in fixtures with standard E39 or EX39 sockets. Bulbs with EX39 bases have protective shields so can be used in either open or closed fixtures. SHOP FOR EX39 BULBS E39 Mogul Base Bulbs with E39 base will only...
www.bulbamerica.com
E39 and e40 are interchangeable afaict