<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">+1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Also, for the equivalence to hold there is no separate Py_XSETREF, the X behaviour is implied, which I favour.  Enough of this X-proliferation already!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">But also see the discussion on inlines.  It would be great to make this an inline rather than a macro.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">K<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Python-Dev [mailto:python-dev-bounces+kristjan=ccpgames.com@python.org]
<b>On Behalf Of </b>Nick Coghlan<br>
<b>Sent:</b> 28. febrúar 2014 12:27<br>
<b>To:</b> Larry Hastings<br>
<b>Cc:</b> python-dev@python.org<br>
<b>Subject:</b> Re: [Python-Dev] Poll: Py_REPLACE/Py_ASSIGN/etc<o:p></o:p></span></p>
</div>
</div>
<div>
<p>For additional context, the idea itself is necessary for the same reason Py_CLEAR was added: to help ensure that an object's state is never pointing at another object that is in the process of being deleted. The difference is that Py_CLEAR only allows setting
 the pointer to NULL, while the point of the new macro is to set it to an arbitrary existing point. There is no implicit incref as that isn't needed for correctness (you can do the incref before the pointer replacement, and often the reference count will already
 be correct without an explicit incref anyway).<o:p></o:p></p>
<p>With the new macro in place, the existing Py_CLEAR(x) macro would be equivalent to Py_SETREF(x, NULL).<o:p></o:p></p>
<p>Originally I was also concerned about the "how will people know there's no implicit incref?", but I've since become satisfied with the fact that the precedent set by the reference stealing SET_ITEM macros is strong enough to justify the shorter name.<o:p></o:p></p>
<p>Cheers,<br>
Nick.<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>