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

2018-06-27 Thread Eloi Gaudry
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-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
e able to have their attributes changed. but the extension needs 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]

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

2018-06-26 Thread Eloi Gaudry
t the same constraints and purposes, this should be reflected 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:

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

2018-06-21 Thread Eloi Gaudry
_TYPE serves other purposes - extension would benefit for allowing direct 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-

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-06-06 Thread Eloi Gaudry
The check is made against a boolean value in the C extension, I don't think that it offers a significant speed-up against the pure python code. but it offers a simpler (reduced, global) assertion syntax though. From: Python-ideas on behalf of Kyle Lahnakoski S

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-06-05 Thread Eloi Gaudry
" ? Le 05/05/2018 à 10:04, Eloi Gaudry a écrit : > > Hi folks, > > > I intend to add a runtime assertion feature in python. Before > submitting a PEP, I am sending a draft to this mailing list to > discuss whether it would make sense (above this message). I

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-17 Thread Eloi Gaudry
On Thu, 2018-05-17 at 03:09 +1000, Steven D'Aprano wrote: > On Wed, May 16, 2018 at 01:27:50PM +0000, Eloi Gaudry wrote: > > On Wed, 2018-05-16 at 21:15 +1000, Steven D'Aprano wrote: > > > On Wed, May 16, 2018 at 08:29:00AM +, Eloi Gaudry wrote: > > > >

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-16 Thread Eloi Gaudry
On Wed, 2018-05-16 at 21:15 +1000, Steven D'Aprano wrote: > On Wed, May 16, 2018 at 08:29:00AM +0000, Eloi Gaudry wrote: > > Is there some interest in the proposal or should I finally close > > this > > thread ? > > I'm definitely interested in the c

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-16 Thread Eloi Gaudry
Is there some interest in the proposal or should I finally close this thread ? Thanks for your feedback, Eloi > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-08 Thread Eloi Gaudry
e where control is indeed by the consumer/the extension? -Original Message- From: Python-ideas On Behalf Of Chris Angelico Sent: Tuesday, May 8, 2018 7:38 PM To: python-ideas@python.org Subject: Re: [Python-ideas] Runtime assertion with no overhead when not active On Wed, May 9,

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-08 Thread Eloi Gaudry
On Wed, 2018-05-09 at 01:34 +1000, Steven D'Aprano wrote: > On Tue, May 08, 2018 at 07:37:55AM +0000, Eloi Gaudry wrote: > > > * debug assert, for helping developing a new features, used with > > debug- > > builds > > * runtime assert, for ensuring correctne

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-08 Thread Eloi Gaudry
On Tue, 2018-05-08 at 09:58 -0400, Eric V. Smith wrote: > I think what's confusing to me (and maybe others) is that we haven't  > seen your vision on how this would look in Python code. > > An example that would throw runtime assertions and the same example  > where it wouldn't (after a global swi

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-08 Thread Eloi Gaudry
On Tue, 2018-05-08 at 07:37 -0700, Guido van Rossum wrote: > > > In Lisp this would be easy. :-) > > > > and he already has a diff ready for review if needed (basically > > very > > similar to the current 'assert' implementation :) > > That seems premature. There is not even a hint of agreement t

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-08 Thread Eloi Gaudry
On Tue, 2018-05-08 at 09:35 -0400, Eric V. Smith wrote: > On 5/8/2018 3:37 AM, Eloi Gaudry wrote: > > On Mon, 2018-05-07 at 16:56 +, Brett Cannon wrote: > > > > > > My question is how is this different to running with -O which > > > leaves > > > th

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-08 Thread Eloi Gaudry
On Mon, 2018-05-07 at 16:56 +, Brett Cannon wrote: > > My question is how is this different to running with -O which leaves > the assert statement out of the bytecode and so you avoid any run- > time cost of the statement entirely?  Not so much different, except that: - the switch won't need

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

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-08 Thread Eloi Gaudry
On Mon, 2018-05-07 at 10:52 -0700, Guido van Rossum wrote: > On Mon, May 7, 2018 at 6:24 AM, Serhiy Storchaka > wrote: > > I just don't understand why you need a new keyword for writing > > runtime checks. > > Oh, that's pretty clear. The OP wants to be able to turn these checks > off with some f

[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

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-07 Thread Eloi Gaudry
On Sun, 2018-05-06 at 01:30 +1000, Steven D'Aprano wrote: > On Sat, May 05, 2018 at 08:04:45AM +0000, Eloi Gaudry wrote: > > > Hi folks, > > I intend to add a runtime assertion feature in python. > > I'm very interested in this idea, but I'm afraid your dra

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-07 Thread Eloi Gaudry
rtion with no overhead when not active 05.05.18 18:04, Eloi Gaudry пише: > By 'self-contained', I meant that using the assert keyword and its > expression is sufficient. An inline assertive expression as the one you > describe does not fulfill this assert requirement. Sufficient f

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-05 Thread Eloi Gaudry
off/on at runtime. The syntax example I gave illustrated what I meant by syntax aware. De : Serhiy Storchaka Envoyé : samedi 5 mai à 15:10 Objet : Re: [Python-ideas] Runtime assertion with no overhead when not active À : python-ideas@python.org 05.05.18 15:54, Eloi Gaudry пише: > I meant

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-05-05 Thread Eloi Gaudry
ntax -Original Message- From: Python-ideas On Behalf Of Serhiy Storchaka Sent: Saturday, May 5, 2018 2:05 PM To: python-ideas@python.org Subject: Re: [Python-ideas] Runtime assertion with no overhead when not active 05.05.18 11:04, Eloi Gaudry пише: > Briefly, the idea is to ad

[Python-ideas] Runtime assertion with no overhead when not active

2018-05-05 Thread Eloi Gaudry
Hi folks, I intend to add a runtime assertion feature in python. Before submitting a PEP, I am sending a draft to this mailing list to discuss whether it would make sense (above this message). I have actually been using it for the last 2 years and it has proven to be robust and has achieved its