Courseiva

PCAP

Full exam simulation

1:05:00
1

Object-Oriented Programming

easy

A junior developer writes a class 'Logger' that should only ever have one instance (singleton). They attempt to implement it by overriding __new__ to always return the same instance. However, when multiple threads attempt to create a Logger, they sometimes get different instances. Which modification will make the singleton thread-safe?

0 of 169 answered