Python Documentation
for the Weak Reference extension module
|
This function returns a string with the copyright information.
This function returns a string with the license information.
Creates a new instance of a weak reference to the object passed in as a parameter to the function.Example:import weakrefobj = FooClass ()wr = weakref.new (obj)obj2 = wr.newref ()
The object represents a weak reference to Python object.
This method returns a new reference to the object held by the weak reference object. This method will return a reference to None if the original object no longer exists.
This method returns a new reference to the object type of the object held by the weak reference object. This method will return a reference to None if the original object no longer exists.
Definition: Return a class attribute by name
Return: A borrowed reference to the attribute that was found; A reference to None if the attribute was not found
Parameters:
self - a reference to the class instance name - the name of the attribute to be found
Definition: Compares two weak reference objects
Return: a number
0 - if the objects are equal; -1 - if this object's pointer is less then that object's pointer 1 - if this object's pointer is greater then that object's pointerParameters:
self - reference to the instance of a weak reference object thatObj - reference to another instance of a weak reference object
Definition: Print out a readable representation of the weak reference object
Return: a new reference to the string that contains a readable representation of the weak reference object
Parameters: self - reference to the instance of a weak reference object
Definition: Returns a hash number for an instance of a weak reference object
Return: hash number for the C pointer to the weak referenced object. Two instances of the weak reference object that references the exact same Python object must return the same hash numbers.
Parameters: self - reference to the instance of a weak reference object