Details
-
Bug
-
Resolution: Invalid
-
Medium
Description
The Singleton pattern doesn't work with new style classes (which includes Python 3.0) I've tested using version 2.5.4 (used object in my class definition) and in version 3.0 and saw the same results. Finally the backticks are deprecated in 3.0 and should be replaced with repr().
**program output **(obviously your will differ)
In [56]: run SingletonPattern
<main.OnlyOne object at 0x01652C10>
<main.OnlyOne object at 0x01652A90>
<main.OnlyOne object at 0x01652F50>
<main.OnlyOne object at 0x01652C10>
<main.OnlyOne object at 0x01652A90>
<main.OnlyOne object at 0x01652C10>
<main.OnlyOne object at 0x01652A90>
<main.OnlyOne object at 0x01652F50>