Can we use singleton functionality without making a singleton class in Python?



Can we use singleton functionality without making a singleton class in Python?..

Answer / Ashish Kumar Kashyap

Although Python doesn't have a built-in way to create singletons like some other languages, you can still achieve the singleton pattern by using global variables or metaclasses.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How does determine the python manage the memory?

1 Answers  


How do I emulate os.kill() in windows?

1 Answers  


In python, are there any databases to DB packages?

1 Answers  


What is the process to get the home directory using ‘~' in python?

0 Answers  


Write a regular expression that will accept an email id. Use the re module.

1 Answers  


Does the functions help() and dir() list the names of all the built_in functions and variables? If no, how would you list them?

1 Answers  


Where is python in anaconda?

1 Answers  


Is empty string python?

1 Answers  


What does the ‘#’ symbol do in Python?

3 Answers  


Explain different way to trigger/ raise exception in your python script?

1 Answers  


Which databases are supported by python?

1 Answers  


What language is python based on?

1 Answers  


Categories