<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">some literature:</p>
<p style="margin-top:0;margin-bottom:0"><a href="https://mail.python.org/pipermail/python-dev/2008-February/077180.html" class="OWAAutoLink" id="LPlnk25528" previewremoved="true">https://mail.python.org/pipermail/python-dev/2008-February/077180.html</a></p>
<p style="margin-top:0;margin-bottom:0"><a href="https://mail.python.org/pipermail/python-dev/2008-February/077180.html" class="OWAAutoLink" id="LPlnk52352" previewremoved="true"></a><a href="https://mail.python.org/pipermail/python-dev/2008-February/077169.html" class="OWAAutoLink" id="LPlnk884690" previewremoved="true">https://mail.python.org/pipermail/python-dev/2008-February/077169.html</a></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">where it is stated that python C struct type should not be able to have their attributes changed.</p>
<p style="margin-top:0;margin-bottom:0">but the extension needs is clearly not taken into account.<br>
<br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Python-ideas <python-ideas-bounces+eloi.gaudry=fft.be@python.org> on behalf of Eloi Gaudry <Eloi.Gaudry@fft.be><br>
<b>Sent:</b> Thursday, June 21, 2018 5:26:37 PM<br>
<b>To:</b> python-ideas@python.org; encukou@gmail.com<br>
<b>Subject:</b> Re: [Python-ideas] Allow mutable builtin types (optionally)</font>
<div> </div>
</div>
<meta content="text/html; charset=us-ascii">
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">This request didn't have a lot of traction, but <span style="font-size:12pt">I still consider this is something that would need to be supported (2 lines of code to be changed; no regression so far with python 2 and python
 3).</span></p>
<p style="margin-top:0; margin-bottom:0"><span style="font-size:12pt"><br>
</span></p>
<p style="margin-top:0; margin-bottom:0">My main points are:</p>
<p style="margin-top:0; margin-bottom:0">- HEAP_TYPE is not really used (as anyone being using it ?)</p>
<p style="margin-top:0; margin-bottom:0">- HEAP_TYPE serves other purposes </p>
<p style="margin-top:0; margin-bottom:0">- extension would benefit for allowing direct access to any of its type attributes</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Petr, what do you think ?</p>
<p style="margin-top:0; margin-bottom:0">Eloi</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Python-ideas <python-ideas-bounces+eloi.gaudry=fft.be@python.org> on behalf of Eloi Gaudry <Eloi.Gaudry@fft.be><br>
<b>Sent:</b> Tuesday, May 8, 2018 9:26:47 AM<br>
<b>To:</b> encukou@gmail.com; python-ideas@python.org<br>
<b>Subject:</b> Re: [Python-ideas] Allow mutable builtin types (optionally)</font>
<div> </div>
</div>
<div class="x_BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="x_PlainText">On Mon, 2018-05-07 at 15:23 -0400, Petr Viktorin wrote:<br>
> On 05/07/18 11:37, Eloi Gaudry wrote:<br>
> > I mean, to my knowledge, there is no reason why a type should be<br>
> > allocated on the heap (<a href=""></a>https://docs.python.org/2/c-api/typeobj.html<br>
> > ) to<br>
> > be able to change its attributes at Python level.<br>
> <br>
> One reason is sub-interpreter support: you can have multiple <br>
> interpreters per process, and those shouldn't influence each other.<br>
> (see <a href="https://docs.python.org/3/c-api/init.html#sub-interpreter-suppor">
https://docs.python.org/3/c-api/init.html#sub-interpreter-suppor</a><br>
> t)<br>
> <br>
> With heap types, each sub-interpreter can have its own copy of the<br>
> type <br>
> object. But with builtins, changes done in one interpreter would be <br>
> visible in all the others.<br>
<br>
Yes, this could be a reason, but if you don't rely on such a feature<br>
neither implicitly nor explicitly ?<br>
<br>
I mean, our types are built-in and should be considered as immutable<br>
across interpreters. And we (as most users I guess) are only running<br>
one interpreter.<br>
<br>
In case several intepreters are used, it would make sense to have a<br>
non-heap type that would be seen as a singleton across all of them, no<br>
?<br>
_______________________________________________<br>
Python-ideas mailing list<br>
Python-ideas@python.org<br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/">http://python.org/psf/codeofconduct/</a><br>
</div>
</span></font></div>
</div>
</body>
</html>