[Tutor] Writing decorators?
ben+python at benfinney.id.au
Wed Jul 20 07:47:53 EDT 2016
Michael Welle <mwe012008 at gmx.net> writes:
> so 'the function has changed' really means 'the reference has
> changed'? Strange.
Humans think in strage ways :-)
Really, though, it shouldn't be too surprising. The *perception* is that
the reference (a name, or an index in a sequence, or whatever) remains
unchanged; at least, you still address the reference exactly the same
way. ‘foo’ in the code remains ‘foo’.
But what you get from that reference is different. So, because what I
get when I refer to ‘foo’ is different after some operation than what
it was prior to that operation, it is natural to speak loosely about
“this operation has changed foo”.
> If you hear 'function foo', do you think of the reference 'foo' or do
> you think of the referenced thing, the function object? It might be
> context dependent, but usually I think about the latter.
It is normal for us to think of them as one, because in Python the
*only* way to get an object is through some specific reference. Our
natural language doesn't easily handle the separable but linked
> But it might just be a language problem.
Which is another way of saying thta it's a human thinking problem. Try
not to have overly strict expectations of how people think about it,
while also striving to express ourselves precisely.
\ “Dvorak users of the world flgkd!” —Kirsten Chevalier, |
`\ rec.humor.oracle.d |
More information about the Tutor