In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains the "python tag deletion how to achieve", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "python tag deletion how to achieve" it!
Description
1. Mainly solve the data referenced by circulation. Because the reference is greater than 0, it will not be recycled.
2. The tag deletion is to solve the problem that the circular reference cannot be deleted.
3. For each reference-1 after the deletion operation, the reference of num,num1 is 0. Put it in the death container, and if the reference is greater than 0, put it in the survival container.
Iterate through the survival container to see if any of the survival containers refer to the objects of the dead container, and if so, take them out of the death container and put them in the survival container.
All objects in the death container have been deleted.
Example
Num = ["hello", "world"] num1 = ["hi", "are", "you"] print (sys.getrefcount (num)) print (sys.getrefcount (num1)) num.append (num1) num1.append (num) print (sys.getrefcount (num)) print (sys.getrefcount (num1) del numdel num1) Thank you for reading, this is the content of "how to achieve python tag deletion", after the study of this article I believe that you have a deeper understanding of how to delete python tags, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.