the - option can be used to specify warning filter on the command line the general format of this option is -waction:message:category:module:lineno where each part has the same meaning as for the filterwarning(function howeverin this casethe message and module fields specify substrings (instead of regular expressionsfor the first part of the warning message and module name to be filteredrespectively weakref the weakref module is used to provide support for weak references normallya reference to an object causes its reference count to increase--effectively keeping the object alive until the reference goes away weak referenceon the other handprovides way of referring to an object without increasing its reference count this can be useful in certain kinds of applications that must manage objects in unusual ways for examplein an object-oriented programwhere you might implement relationship such as the observer patterna weak reference can be used to avoid the creation of reference cycles an example of this is shown in the "object memory managementsection of weak reference is created using the weakref ref(function as followsclass apass (ar weakref ref(acreate weak reference to print ar once weak reference is createdthe original object can be obtained from the weak reference by simply calling it as function with no arguments if the underlying object still existsit will be returned otherwisenone is returned to indicate that the original object no longer exists for exampleprint ar(print original object del delete the original object print ar( is goneso this now returns none none the following functions are defined by the weakref moduleref(object[callback]creates weak reference to object callback is an optional function that will be called when object is about to be destroyed if suppliedthis function should accept single argumentwhich is the corresponding weak reference object more than one weak reference may refer to the same object in this casethe callback functions will be called in order from the most recently applied reference to the oldest reference object can be obtained from weak reference by calling the returned weak reference object as function with no arguments if the original object no longer existsnone lib fl ff