text: # -*- coding: utf-8 -*-
  # --------------------------------------------------------
  # Licensed under the terms of the BSD 3-Clause License
  # (see LICENSE for details).
  # Copyright © 2018-2021, A.A Suvorov
  # All rights reserved.
  # --------------------------------------------------------
  """Singleton"""
  
  
  class Singleton:
      def __new__(cls):
          if not hasattr(cls, 'instance'):
              cls.instance = super(Singleton, cls).__new__(cls)
          return cls.instance
  
  
  def main():
      sing1 = Singleton()
      sing2 = Singleton()
      print(sing1 is sing2)  # True
  
  
  if __name__ == '__main__':
      main()
  