Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-03-12 Thread Brett Cannon
On Tue Mar 11 2014 at 11:59:23 PM, Chris Angelico ros...@gmail.com wrote: On Wed, Mar 12, 2014 at 2:20 PM, Ethan Furman et...@stoneleaf.us wrote: I sure hope this is accepted. I could have used it at least a half-dozen times in the last week -- which is more often than I would have used the

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Brett Cannon
On Wed, Mar 12, 2014 at 12:10 AM, Chris Angelico ros...@gmail.com wrote: PEP 463, Exception-catching expressions, is stable and I believe ready for pronouncement. Drumroll please... http://www.python.org/dev/peps/pep-0463/ PEP: 463 Title: Exception-catching expressions Version: $Revision$

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Chris Angelico
On Thu, Mar 13, 2014 at 2:14 AM, Brett Cannon br...@python.org wrote: While I'm +0 on the idea, I'm -1 on the syntax; I just don't like having a colon in an expression. Which is why there are alternatives listed, and the best four of them (including the proposed one) ranked. ChrisA

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Brett Cannon
On Wed, Mar 12, 2014 at 11:16 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Mar 13, 2014 at 2:14 AM, Brett Cannon br...@python.org wrote: While I'm +0 on the idea, I'm -1 on the syntax; I just don't like having a colon in an expression. Which is why there are alternatives listed, and

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Barry Warsaw
On Mar 12, 2014, at 11:14 AM, Brett Cannon wrote: While I'm +0 on the idea, I'm -1 on the syntax; I just don't like having a colon in an expression. I'm -0 on the idea, mostly be cause it's never occurred to me to even need something like this, and because I don't personally think the existing

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Chris Angelico
On Thu, Mar 13, 2014 at 2:44 AM, Barry Warsaw ba...@python.org wrote: That being said, the colon really bothers me, despite what is written in Common objections. True, colons are used in places other than suite introduction, but with exception handling, colons *do* introduce a new suite, so

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Paul Moore
On 12 March 2014 16:05, Chris Angelico ros...@gmail.com wrote: Tooling issues should already have been solved for lambda, but if you don't like the colon, go with one of the other options - Brett expressed support for 'then', which makes very good sense (it does require creating a new keyword,

[Python-Dev] Fwd: Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Jeremy Kloth
[resending to list] -- Forwarded message -- From: Jeremy Kloth jeremy.kl...@gmail.com Date: Wed, Mar 12, 2014 at 10:27 AM Subject: Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions To: Chris Angelico ros...@gmail.com On Wed, Mar 12, 2014 at

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Gustavo Carneiro
On 12 March 2014 15:21, Brett Cannon br...@python.org wrote: On Wed, Mar 12, 2014 at 11:16 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Mar 13, 2014 at 2:14 AM, Brett Cannon br...@python.org wrote: While I'm +0 on the idea, I'm -1 on the syntax; I just don't like having a

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Guido van Rossum
On Tue, Mar 11, 2014 at 9:10 PM, Chris Angelico ros...@gmail.com wrote: PEP 463, Exception-catching expressions, is stable and I believe ready for pronouncement. Drumroll please... http://www.python.org/dev/peps/pep-0463/ PEP: 463 Title: Exception-catching expressions Version: $Revision$

Re: [Python-Dev] Why not make frames? [was: Alternative forms [was: PEP 463: Exception-catching expressions]]

2014-03-12 Thread R. David Murray
On Mon, 10 Mar 2014 14:26:14 +1100, Chris Angelico ros...@gmail.com wrote: On Mon, Mar 10, 2014 at 1:16 PM, Jim J. Jewett jimjjew...@gmail.com wrote: I don't claim that syntax is perfect. I do think it is less flawed than the no-parentheses (or external parentheses) versions: (expr1

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Ethan Furman
On 03/12/2014 10:09 AM, Guido van Rossum wrote: I want to reject this PEP. [...] But the thing I can't get behind are the motivation and rationale. I don't think that e.g. dict.get() would be unnecessary once we have except expressions, and I disagree with the position that EAFP is better

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Barry Warsaw
On Mar 12, 2014, at 10:40 AM, Ethan Furman wrote: Does this mean a better motivation and rationale may cause you to change your mind? My motivation is for simpler, easier to read code: instead of a full-blown try/except block or a double-lookup into an indexable object I would much rather do:

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-03-12 Thread Martin v. Löwis
Am 12.03.14 04:58, schrieb Chris Angelico: On Wed, Mar 12, 2014 at 2:20 PM, Ethan Furman et...@stoneleaf.us wrote: I sure hope this is accepted. I could have used it at least a half-dozen times in the last week -- which is more often than I would have used the ternary-if! :) Where do we

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Chris Angelico
On Thu, Mar 13, 2014 at 4:09 AM, Guido van Rossum gu...@python.org wrote: But the thing I can't get behind are the motivation and rationale. I don't think that e.g. dict.get() would be unnecessary once we have except expressions, and I disagree with the position that EAFP is better than LBYL,

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Chris Angelico
On Thu, Mar 13, 2014 at 7:14 AM, Barry Warsaw ba...@python.org wrote: Interestingly enough, where ternaries are most useful are in the same situations where I think exception expressions would be most useful, in the setting of a variable or attribute to one of two different values. In both

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-03-12 Thread Chris Angelico
On Thu, Mar 13, 2014 at 7:26 AM, Martin v. Löwis mar...@v.loewis.de wrote: I think you (or someone) first needs to find a BDFL delegate. Traditionally, with syntax changes, there is a good chance that Guido doesn't want to delegate at all, so ask him whether he wants to delegate or not. He

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Emile van Sebille
On 3/12/2014 1:44 PM, Chris Angelico wrote: unless someone's going to employ me to champion PEPs full time :) (Hmm. That would be an interesting job title on the resume.) It's available now -- www.pepboys.com :) Emile ___ Python-Dev mailing list

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/12/2014 04:49 PM, Chris Angelico wrote: You can use hasattr() in place of AttributeError I use: getattr(subject, attrname, default)? *all the time*. Tres. - -- === Tres

Re: [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

2014-03-12 Thread Chris Angelico
On Thu, Mar 13, 2014 at 8:37 AM, Tres Seaver tsea...@palladion.com wrote: On 03/12/2014 04:49 PM, Chris Angelico wrote: You can use hasattr() in place of AttributeError I use: getattr(subject, attrname, default)? *all the time*. Umm, yeah, that one. Why did I think hasattr was the only