<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, 20 Mar 2016 at 09:44 Facundo Batista <<a href="mailto:facundobatista@gmail.com">facundobatista@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<br>
I'm seeing that our code increases the reference counting to Py_None,<br>
and I find this a little strange: isn't Py_None eternal and will never<br>
die?<br></blockquote><div><br></div><div>Semantically yes, but we have to technically make that happen. :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
What's the point of counting its references?<br></blockquote><div><br></div><div>It's just another Python object, so if you return it then the code that receives it may very well decref it because it always DECREFs the object returned. And if we didn't keep its count accurately it would eventually hit zero and constantly have its dealloc function checked for. We could add a magical "never dies" value for the refcount, but that adds another `if` branch in all the code instead of simply treating Py_None like any other object and properly tracking its  reference.</div></div></div>