<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        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:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:2020933865;
        mso-list-type:hybrid;
        mso-list-template-ids:406354076 -399884518 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></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-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="FR-BE" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi Guido,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-BE" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I would like to be sure that the lack of support would not be the result of my inability to sum-up my use case.<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>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">This is why I gave some links to illustrate<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">       
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">the reason why the behavior was changed a decade ago<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">       
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">that such a possibility was actually needed by other extension developers (where their built-in types would benefit from being able to redefine some
 method dynamically)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">       
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">that python core developers and python extension developers can have different needs and objectives (which was the main reason why I was submitting
 this to the mailing-list again)<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>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I feel sorry if that only resulted in looking like I was repeating myself.<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>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Have a good day,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Eloi<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>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Guido van Rossum <guido@python.org>
<br>
<b>Sent:</b> Tuesday, June 26, 2018 7:20 PM<br>
<b>To:</b> Eloi Gaudry <Eloi.Gaudry@fft.be><br>
<b>Cc:</b> Python-Ideas <python-ideas@python.org>; Serhiy Storchaka <storchaka@gmail.com><br>
<b>Subject:</b> Re: [Python-ideas] Allow mutable builtin types (optionally)<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hey Eloi,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I think you need to just give up on this. Nobody here seems to support or understand your use case. At this point you are repeating yourself (again claiming there is no good reason for the prohibition and that it's only a few lines of code
 to change) and you can be assured that the response will also be the same.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">--Guido<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Jun 26, 2018 at 8:00 AM Eloi Gaudry <<a href="mailto:Eloi.Gaudry@fft.be">Eloi.Gaudry@fft.be</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div id="m_2483186568167295880divtagdefaultwrapper">
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black">the origin of this feature disappearing for built-in types:<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black"><a href="http://bugs.jython.org/issue1058" target="_blank" id="m_2483186568167295880LPlnk825442">http://bugs.jython.org/issue1058</a><o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black">'''<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">object.__set/delattr__ allow modification of built in types, this is <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">known as the Carlo Verre hack:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">Jython 2.3a0+ (trunk:4630:4631M, Jun 14 2008, 20:07:38) <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">[Java HotSpot(TM) Client VM (Apple Inc.)] on java1.5.0_13<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">Type "help", "copyright", "credits" or "license" for more information.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">>>> object.__setattr__(str, 'lower', str.upper)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">>>> 'dammit Carlo!'.lower()<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">'DAMMIT CARLO!'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">'''<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">but I do not see any reason why having an explicit flag for python extensions written in C to declare their types as static struct, and still be able to change their __setattr__,
 __getattr__, etc. slots would not make sense.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">extensions and core types have not the same constraints and purposes, this should be reflected on the capabilities the first would have somewhere then.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="3" width="98%" align="center">
</div>
<div id="m_2483186568167295880divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> Eloi Gaudry<br>
<b>Sent:</b> Tuesday, June 26, 2018 4:27:18 PM<br>
<b>To:</b> <a href="mailto:python-ideas@python.org" target="_blank">python-ideas@python.org</a><br>
<b>Subject:</b> Re: [Python-ideas] Allow mutable builtin types (optionally)</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div id="m_2483186568167295880x_divtagdefaultwrapper">
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black">some literature:<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black"><a href="https://mail.python.org/pipermail/python-dev/2008-February/077180.html" target="_blank" id="m_2483186568167295880LPlnk25528">https://mail.python.org/pipermail/python-dev/2008-February/077180.html</a><o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black"><a href="https://mail.python.org/pipermail/python-dev/2008-February/077169.html" target="_blank" id="m_2483186568167295880LPlnk52352">https://mail.python.org/pipermail/python-dev/2008-February/077169.html</a><o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black">where it is stated that python C struct type should not be able to have their attributes changed.<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:0in">
<span style="font-family:"Calibri",sans-serif;color:black">but the extension needs is clearly not taken into account.<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="3" width="98%" align="center">
</div>
<div id="m_2483186568167295880x_divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> Python-ideas <python-ideas-bounces+eloi.gaudry=<a href="mailto:fft.be@python.org" target="_blank">fft.be@python.org</a>>
 on behalf of Eloi Gaudry <<a href="mailto:Eloi.Gaudry@fft.be" target="_blank">Eloi.Gaudry@fft.be</a>><br>
<b>Sent:</b> Thursday, June 21, 2018 5:26:37 PM<br>
<b>To:</b> <a href="mailto:python-ideas@python.org" target="_blank">python-ideas@python.org</a>;
<a href="mailto:encukou@gmail.com" target="_blank">encukou@gmail.com</a><br>
<b>Subject:</b> Re: [Python-ideas] Allow mutable builtin types (optionally)</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div id="m_2483186568167295880x_x_divtagdefaultwrapper">
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black">This request didn't have a lot of traction, but 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).<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black">My main points are:<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black">- HEAP_TYPE is not really used (as anyone being using it ?)<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black">- HEAP_TYPE serves other purposes <o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black">- extension would benefit for allowing direct access to any of its type attributes<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black">Petr, what do you think ?<o:p></o:p></span></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-family:"Calibri",sans-serif;color:black">Eloi<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="3" width="98%" align="center">
</div>
<div id="m_2483186568167295880x_x_divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"> Python-ideas <python-ideas-bounces+eloi.gaudry=<a href="mailto:fft.be@python.org" target="_blank">fft.be@python.org</a>>
 on behalf of Eloi Gaudry <<a href="mailto:Eloi.Gaudry@fft.be" target="_blank">Eloi.Gaudry@fft.be</a>><br>
<b>Sent:</b> Tuesday, May 8, 2018 9:26:47 AM<br>
<b>To:</b> <a href="mailto:encukou@gmail.com" target="_blank">encukou@gmail.com</a>;
<a href="mailto:python-ideas@python.org" target="_blank">python-ideas@python.org</a><br>
<b>Subject:</b> Re: [Python-ideas] Allow mutable builtin types (optionally)</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">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="https://docs.python.org/2/c-api/typeobj.html" target="_blank">https://docs.python.org/2/c-api/typeobj.html</a><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" target="_blank">
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>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" target="_blank">http://python.org/psf/codeofconduct/</a><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<br>
-- <o:p></o:p></p>
<div>
<p class="MsoNormal">--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)<o:p></o:p></p>
</div>
</div>
</body>
</html>