Re: Please explain the meaning of 'stealing' a ref

From: Christos (tzot_at_sil-tec.gr)
Date: 11/06/03


Date: Thu, 06 Nov 2003 18:28:28 +0200

My last post in this thread, since it --like Alex noticed too-- tends to
move into 'off-topic' territory.

On Thu, 06 Nov 2003 14:30:30 GMT, rumours say that Alex Martelli
<aleax@aleax.it> might have written:

[snip: Alex ponders on whether the thread remains on topic (it merely
does), then states that, as an author himself, has strong opinions on
style, nuances, fine point of connotation etc]

Point taken, and be sure that all my respect goes to acknowledged
authors like yourself; after all, we don't discuss one of your books or
your style here, but rather the python documentation and how it could be
improved for newcomers --not that *I* *know* how to improve it. I only
pointed parts that might be as unclear to others as to me.

[snip: I suggesting a defining "owning a reference", Alex
counter-proposing a variation to the current doc sentence about what a
function that owns a reference has to do, I accidentally ignoring the
counter proposal, summarising instead where in the docs the answers to
my questions can be collected from]

>So what about my proposed transliteration of "when X, Y" into "X
>means Y"? This is similar to (e.g.) changing "when somebody owns
>a property outright, they can sell it" to "owning a property
>outright means you can sell it" -- essentially equivalent in normal
>English usage, but perhaps more specific or clear to non-natives?

I really have no preference between the two. I believe they carry the
same amount of information. Sorry for not commenting upon your
proposal.

>>>> This text is obviously clear
[snip: I acknowledge a fault on my part in keeping in mind the
difference between owning an object and owning a reference, Alex
re-states the fact that the documentation is clearest on this, I mistake
at a point Alex's use of second person in his sentence as referring to
me, and Alex explains that he used 'you' as a generic person (my
comment: à la 'on' in French) instead of me specifically.]

Explanation and not justification: In English I have met more often the
idiom 'one can only hope' than 'you can only hope' when speaking in
general, so I perceived you meant me. After your clarification, I
understand it's a null issue.

[snip: discussion about the phrase 'Few functions steal references; the
two notable exceptions are...']

Sorry for snipping all of your reply, but this should be kept short. Do
you believe that the following:

'Few functions steal references; of these exceptions, the two notable
are...'

is more to the point of passing the message that the word 'exceptions'
after the semicolon means a subset of the exceptions referenced before
the semicolon?

If you really believe this is a moot point, please, let's drop the
subject without further discussion on this. I insist on my point for
clarity, but I am not an expert, cause I am a self-taught English
speaker (by listening to songs, watching cinema and TV, and practicing
whenever I could with native speakers (mostly British, apart from two
trips to the States)).
I say to drop the subject if you disagree because, pragmatically
speaking, your opinion counts more than mine, so let's keep our energies
for more grave matters.

[snip some more discussion about the 'exceptions' subject]

>> If the python documentation had a terminology dictionary, how would
>> 'stealing', 'borrowing' and 'owning' a reference be defined in a concise
>> and absolutely clear way? I seem to not be able to write these
>> definitions, although I would like to.
>
>The concept of "owning a reference" is the crucial one. "Stealing"
>is just one way to permanently transfer ownership, "borrowing" means
>no transfer of ownership takes place, and these meanings are so close
>to those in everyday language that the "terminology dictionary" would
>have few problems, I believe.
>
>So, focusing on ownership, and foregoing the concision that would
>probably be required in a dictionary, we might say:
>
>"""
>Ownership pertains to references, never to objects (objects are not
>owned: they are always shared). "Owning a reference" means being
>responsible for calling Py_DECREF on it when the reference is no
>longer needed. Ownership can also be transferred, meaning that the
>code that receives ownership of the reference then becomes
>responsible for eventually decref'ing it when it's no longer needed.
>"""
>
>plus, perhaps, pointers to the various appropriate sections in
>the "extending and embedding" tutorial and API reference that deal
>with this concept. Really, the true meaning of "reference
>ownership" is _operational_ -- the "responsibility of eventually
>decref'ing (unless the ownership is transferred)" _together_ with
>the rules for how and when ownership (i.e. responsibility to
>eventually decref) is transferred.

There you go, back to your excellent ability to reply to answers in a
way that seems definite. That's the Alex before the tiresome
python-syntax-in-lisp thread :)

The above text in triple-quotes, believe me, is what I sought since the
start. Our discussion really helped me answer my questions before I
read it clearly in your post; and I firmly believe that your
triple-quoted text should be added to the documentation.

I just submitted patch 837322 merging your words above into the
documentation text --please revise.

Thanks for your time.

-- 
TZOTZIOY, I speak England very best,
Ils sont fous ces Redmontains! --Harddix


Relevant Pages

  • Re: Evolution of PL/I
    ... also specified, exp1, exp2, and exp3 will be evaluated prior to the assignment of exp1 to the reference. ...
    (comp.lang.pl1)
  • Re: OT: Snit is spinning a bunch of Snot
    ... Snit wrote: ... like the FACT that Apple doesn't support third ... site and didn't mention, or reference in any way, shape or form Auto-install ...
    (comp.sys.mac.advocacy)
  • Re: whats next for the linux kernel?
    ... Files are deleted if the last reference is gone. ... Directories are lists of references, and these lists are independent from ...
    (Linux-Kernel)
  • Re: Strong vs. Normal Thread Safety.
    ... Where do you put transfer of ownership e.g. ... the reference count needs to ... I have no idea what you mean by "normal thread-safety" in this case. ... I am not concerned with the thread safety level of the user object. ...
    (comp.programming.threads)
  • Re: Getting Warmth From My Twin Reverb...
    ... Take a look at every reference I gave you in my previous ... but you are not explicitly stating it. ... a simile is an approximation or comparison. ...
    (alt.guitar.amps)