I'm experimenting with the Dill package, specifically it's detect module and having some trouble intuitively understanding what's is meant by referents, referers, parents and children.
A reference is a value that enables access to some data.
And referents are objects that are referred to, right?
So in the following code:
class MyClass:
"""A simple example class"""
i = 12345
def f(self):
return 'hello world'
an_instance = MyClass()
an_instance2 = MyClass()
an_instance3 = MyClass()
a_list = [an_instance, an_instance2, an_instance3]
Are an_instance, an_instance2, an_instance3
referents of a_list
and would the MyClass
also be a referent of a_list
, but one level of depth further up the chain?
So, with ->
signifying the reference, would the chain of referents look like:
a_list -> an_instance -> MyClass
Would this be viewed as:
grandchild -> child -> Parent
Conversely, is a_list
a referrer of an_instance
as well as an_instance2, an_instance3
and at another level of depth, MyClass
?
Making the chain of referrers:
MyClass -> an_instance -> a_list
And would this also be conceived:
parent -> child -> grandchild
Can someone offer a clear explanation of where references, inheritance and containers do and don't coincide?