Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #79938
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2014-10-29 12:23 -0700 |
| References | <406463d0-1287-49a2-b1ed-08a928db4b94@googlegroups.com> <AC2E1A3CADA66941BB826F325E0EFD0F28C2C1@EX2K10MBX1.ad.london.inspiredbroadcast.net> <mailman.15296.1414583954.18130.python-list@python.org> |
| Message-ID | <9806dae0-a47b-4aa8-aba0-0b2a69d002b2@googlegroups.com> (permalink) |
| Subject | Re: Python Style Question |
| From | Anton <anton.schattenfeld@gmail.com> |
On Wednesday, October 29, 2014 4:59:25 AM UTC-7, Rafael Romero Carmona wrote: > 2014-10-29 12:25 GMT+01:00 Martin Kemp <mar...@ingg.com>: > Actually it doesn't work because there is no add function and it > doesn't catch the TypeError function to ignore other exceptions than > ValueError. Doesn't it? I tested in Python 2.7.6 and 3.4. Originally I was using set instead of list. So it should have been either values = set() or values.append(), but it is not relevant to the question. Regarding TypeError, I don't catch it on purpose, because I want this type of Exception to bubble up and surface as an error and be logged, because this should never be the case. I expect an element to be either something coercible to int or a string. If for some reason it is an object, then there is something wrong one layer up, so I want it to fail explicitly.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python Style Question Anton <anton.schattenfeld@gmail.com> - 2014-10-29 03:42 -0700
Re: Python Style Question Martin Kemp <martin.kemp@ingg.com> - 2014-10-29 11:25 +0000
Re: Python Style Question Rafael Romero Carmona <rafaelromcar@gmail.com> - 2014-10-29 12:09 +0100
Re: Python Style Question Anton <anton.schattenfeld@gmail.com> - 2014-10-29 12:09 -0700
Re: Python Style Question Rafael Romero Carmona <rafaelromcar@gmail.com> - 2014-10-29 12:52 +0100
Re: Python Style Question Anton <anton.schattenfeld@gmail.com> - 2014-10-29 12:23 -0700
Re: Python Style Question Martin Kemp <martin.kemp@ingg.com> - 2014-10-29 12:42 +0000
Re: Python Style Question Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-30 22:10 +1100
Re: Python Style Question MRAB <python@mrabarnett.plus.com> - 2014-10-30 12:21 +0000
Re: Python Style Question Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-31 09:48 +1100
Re: Python Style Question Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-31 04:55 +0000
Re: Python Style Question Roy Smith <roy@panix.com> - 2014-10-30 20:34 -0400
Re: Python Style Question Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-31 14:52 +1100
Re: Python Style Question Anton <anton.schattenfeld@gmail.com> - 2014-11-12 12:31 -0800
csiph-web