Re: [Python-Dev] syntax misfeature (exception)

2007-01-21 Thread Phillip J. Eby
At 01:17 PM 1/20/2007, Josiah Carlson wrote:

Neal Becker [EMAIL PROTECTED] wrote:
[snip]
  It's not a question, it's a critique.  I believe this is a misfeature since
  it's so easy to make this mistake.

And it is going away with Py3k.  Making it go away for Python 2.6 would
either allow for two syntaxes to do the same thing, or would require
everyone to change their except clauses.  Neither is very desireable
(especially if writing code for 2.6 makes it not work for 2.5).

With both, you can choose whether you'd rather your code be backward 
compatible with 2.5, or forward-compatible with 3.0.  So 2.6 has to 
have both syntaxes.



  - Josiah

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/pje%40telecommunity.com

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] syntax misfeature (exception)

2007-01-21 Thread Josiah Carlson

Phillip J. Eby [EMAIL PROTECTED] wrote:
 
 At 01:17 PM 1/20/2007, Josiah Carlson wrote:
 
 Neal Becker [EMAIL PROTECTED] wrote:
 [snip]
   It's not a question, it's a critique.  I believe this is a misfeature 
   since
   it's so easy to make this mistake.
 
 And it is going away with Py3k.  Making it go away for Python 2.6 would
 either allow for two syntaxes to do the same thing, or would require
 everyone to change their except clauses.  Neither is very desireable
 (especially if writing code for 2.6 makes it not work for 2.5).
 
 With both, you can choose whether you'd rather your code be backward 
 compatible with 2.5, or forward-compatible with 3.0.  So 2.6 has to 
 have both syntaxes.

If it's already been decided; great!

 - Josiah

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] syntax misfeature (exception)

2007-01-20 Thread Neal Becker
I accidentally wrote:

try:
 ...
except a,b:

rather than:

try
 ...
except (a,b):

It appears that the 1st example syntax is silently accepted, but doesn't
seem to work.  Is this true?  If so, I'd say it's a wart.

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] syntax misfeature (exception)

2007-01-20 Thread Georg Brandl
Neal Becker schrieb:
 I accidentally wrote:
 
 try:
  ...
 except a,b:
 
 rather than:
 
 try
  ...
 except (a,b):
 
 It appears that the 1st example syntax is silently accepted, but doesn't
 seem to work.  Is this true?  If so, I'd say it's a wart.

Both have a meaning: The first assigns the exception object to b, while the
second catches exception types a and b.

BTW, in Python 3.0, the first will be spelled except a as b.

Please post questions about using the language to the comp.lang.python group.

cheers,
Georg

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] syntax misfeature (exception)

2007-01-20 Thread Neal Becker
Georg Brandl wrote:

 Neal Becker schrieb:
 I accidentally wrote:
 
 try:
  ...
 except a,b:
 
 rather than:
 
 try
  ...
 except (a,b):
 
 It appears that the 1st example syntax is silently accepted, but doesn't
 seem to work.  Is this true?  If so, I'd say it's a wart.
 
 Both have a meaning: The first assigns the exception object to b, while
 the second catches exception types a and b.
 
 BTW, in Python 3.0, the first will be spelled except a as b.
 
 Please post questions about using the language to the comp.lang.python
 group.
 
It's not a question, it's a critique.  I believe this is a misfeature since
it's so easy to make this mistake.

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] syntax misfeature (exception)

2007-01-20 Thread Josiah Carlson

Neal Becker [EMAIL PROTECTED] wrote:
[snip]
 It's not a question, it's a critique.  I believe this is a misfeature since
 it's so easy to make this mistake.

And it is going away with Py3k.  Making it go away for Python 2.6 would
either allow for two syntaxes to do the same thing, or would require
everyone to change their except clauses.  Neither is very desireable
(especially if writing code for 2.6 makes it not work for 2.5).


 - Josiah

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] syntax misfeature (exception)

2007-01-20 Thread Anthony Baxter
On Sunday 21 January 2007 05:17, Josiah Carlson wrote:
 Neal Becker [EMAIL PROTECTED] wrote:
 [snip]

  It's not a question, it's a critique.  I believe this is a
  misfeature since it's so easy to make this mistake.

 And it is going away with Py3k.  Making it go away for Python 2.6
 would either allow for two syntaxes to do the same thing, or
 would require everyone to change their except clauses.  Neither
 is very desireable (especially if writing code for 2.6 makes it
 not work for 2.5).

Note that we do plan to add except a as b to 2.6 - we're just not 
ripping out the old way of doing it.

Anthony
-- 
Anthony Baxter [EMAIL PROTECTED]
It's never too late to have a happy childhood.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com