Parameters: Here parameter “object” is an iterable object. All the elements of the iterable object are added to the WeakSet.
Some different WeakSet functions:
|add(value)||a new object is appended with the given value to the weakset.
|delete(value)||Deletes the value from the WeakSet collection.
|has(value)||Returns true if the value is present in the WeakSet Collection, false otherwise.
|length()||Returns the length of weakSetObject
objectOne added objectTwo added WeakSet has objectTwo : true objectTwo deleted WeakSet has objectTwo : false
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.