Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-06-28 Thread Greg
Mostly historical reasons I guess, we started with static types because most class extension examples were using it, and it worked for all we did at the time (including the __class__ assign trick). We then got hit by the change, and solved the issue by patching python. Now keeping our own patched

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-06-27 Thread Guido van Rossum
So the question remains -- why not use a heap type? On Wed, Jun 27, 2018 at 2:05 AM Greg wrote: > As I introduced (a long time ago) this demand, let me add my grain of salt > here. > > The use case is pretty simple, and somewhat common when writing manually C > extension class: The reason to

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-06-27 Thread Eloi Gaudry
this was something that would indeed need more discussion and might get acceptance if discussed once again. Eloi From: Brett Cannon Sent: Tuesday, June 26, 2018 8:53 PM To: Eloi Gaudry Cc: encu...@gmail.com; python-ideas@python.org Subject: Re: [Python-ideas] Allow mutable builtin types (optionally

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-06-27 Thread Greg
As I introduced (a long time ago) this demand, let me add my grain of salt here. The use case is pretty simple, and somewhat common when writing manually C extension class: The reason to write extension class is usually performance, or link into an existing library. When doing this manually

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-06-26 Thread Eloi Gaudry
again) I feel sorry if that only resulted in looking like I was repeating myself. Have a good day, Eloi From: Guido van Rossum Sent: Tuesday, June 26, 2018 7:20 PM To: Eloi Gaudry Cc: Python-Ideas ; Serhiy Storchaka Subject: Re: [Python-ideas] Allow mutable builtin types (optionally) Hey

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-06-26 Thread Eloi Gaudry
: encu...@gmail.com; python-ideas@python.org Subject: Re: [Python-ideas] Allow mutable builtin types (optionally) On Mon, 2018-05-07 at 15:23 -0400, Petr Viktorin wrote: > On 05/07/18 11:37, Eloi Gaudry wrote: > > I mean, to my knowledge, there is no reason why a type should be > >

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-06-26 Thread Brett Cannon
access to any of its > type attributes > > Petr, what do you think ? > > Eloi > -- > *From:* Python-ideas > on behalf of Eloi Gaudry > *Sent:* Tuesday, May 8, 2018 9:26:47 AM > *To:* encu...@gmail.com; python-ideas@python.org > *Subject

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-06-26 Thread Guido van Rossum
eds is clearly not taken into account. > > -------------- > *From:* Python-ideas > on behalf of Eloi Gaudry > *Sent:* Thursday, June 21, 2018 5:26:37 PM > *To:* python-ideas@python.org; encu...@gmail.com > *Subject:* Re: [Python-ideas] Allow mutable builtin types

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-06-26 Thread Eloi Gaudry
flected on the capabilities the first would have somewhere then. From: Eloi Gaudry Sent: Tuesday, June 26, 2018 4:27:18 PM To: python-ideas@python.org Subject: Re: [Python-ideas] Allow mutable builtin types (optionally) some literature: https://mail.python.org/pipermail/python-dev/2008-February/

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-06-21 Thread Eloi Gaudry
@python.org Subject: Re: [Python-ideas] Allow mutable builtin types (optionally) On Mon, 2018-05-07 at 15:23 -0400, Petr Viktorin wrote: > On 05/07/18 11:37, Eloi Gaudry wrote: > > I mean, to my knowledge, there is no reason why a type should be > > allocated on the heap (https://docs.pyt

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-05-08 Thread Eloi Gaudry
On Mon, 2018-05-07 at 15:23 -0400, Petr Viktorin wrote: > On 05/07/18 11:37, Eloi Gaudry wrote: > > I mean, to my knowledge, there is no reason why a type should be > > allocated on the heap (https://docs.python.org/2/c-api/typeobj.html > > ) to > > be able to change its attributes at Python

Re: [Python-ideas] Allow mutable builtin types (optionally)

2018-05-07 Thread Petr Viktorin
On 05/07/18 11:37, Eloi Gaudry wrote: Hi, I'd like to bring back this discussion (from 2005, by Greg): https://bugs.python.org/issue1229239 Briefly, non-heap types cannot have their attributes changed by Python code. This makes sense for python builtin types, but not for the types defined in

[Python-ideas] Allow mutable builtin types (optionally)

2018-05-07 Thread Eloi Gaudry
Hi, I'd like to bring back this discussion (from 2005, by Greg): https://bugs.python.org/issue1229239 Briefly, non-heap types cannot have their attributes changed by Python code. This makes sense for python builtin types, but not for the types defined in extension/modules. As we have been using