That’s not very under-the-hood though is it?
An expression describes a value
so for example the expression
evaluates to 1
similarly, a function
evaluates to … f
What would you do with a function? Call it, presumably. You now have a different expression, you did something with f
The result is whatever f returns, and f probably returned something other than itself (though it could, nothing stopping it from doing so)
So when you’re deciding whether or not to call something … did you want the thing itself, or its return value?
The dots in your expressions aren’t any different from your parenthesis, you could omit those as well, they too, are operations on values
asks x for its something attribute
doesn’t, that’s x itself
so, if you have some value, then, what operations does that support, and which operations do you want to do to it? you wouldn’t pick operations at random would you? or if you do, don’t expect a particularly meaningful outcome
you’ve got a class.
what would you like to do with it?
usually what you’d do with a class is to create an instance of it. for example:
an_empty_list = list()
calling a class results in an instance of it.
lists_class = list
so now you’ve got two values,
list … those are really different things.
you could ask for attributes from them
what attribute does a list have? what attributes does the list class have?
what makes sense to do with the list class’s append attribute, and what about a list instance’s append attribute?
if you call a list’s append attribute what’ll happen is that the value you provide is added to that list
but if you do the same with the list class, then what list would this add to? it wouldn’t, there’s no list, only the idea of list, a type