How to get the list of all initialized objects and function definitions alive in Python?
In this article, we are going to get the list of all initialized objects and function definitions that are alive in Python, so we are getting all those initialized objects details by using gc module we can get the details. GC stands for garbage collector which is issued to manage the objects in the memory, so from that module, we are using the get_objects() method
Example 1: Python program to get the details of initialized objects.
Here we will create some objects like a list, tuple, dict, and then get the alive initialize object using gc.
Time Complexity: O(n)
Auxiliary Space: O(n)
Example 2: Python program to get the list of initialized functions
My Personal Notes arrow_drop_up
Please Login to comment...