Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #107073
| From | Michael Selik <michael.selik@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Looking for feedback on weighted voting algorithm |
| Date | 2016-04-16 00:35 +0000 |
| Message-ID | <mailman.33.1460766914.6324.python-list@python.org> (permalink) |
| References | (2 earlier) <CAO1D73GG2Rfp6VK1Tr6fL6Ok4sJo55anYXsXK=PVWRfkNKVBrA@mail.gmail.com> <CAGgTfkN8RCzZW2uWuCS+A7hXunP9Fc-TUAZRM3dhdfMhV9YDnQ@mail.gmail.com> <mailman.118.1460666904.15650.python-list@python.org> <3567e3a1-6a55-4471-ad70-dc23e9ad05f4@googlegroups.com> <CAGgTfkNHuywiC=+aeetMJpuCYF5C_u09haKzD8MPS2u4kmP31w@mail.gmail.com> |
On Fri, Apr 15, 2016, 7:56 PM <sohcahtoa82@gmail.com> wrote: > On Thursday, April 14, 2016 at 1:48:40 PM UTC-7, Michael Selik wrote: > > I suggest not worrying about sanitizing inputs. If someone provides bad > > data, Python will do the right thing: stop the program and print an > > explanation of what went wrong, often a more helpful message than one > you'd > > write. Use error handling mostly for when you want to do something > *other* > > than stop the program. > > > > I'm not sure I'd use NaN instead of raise division by zero error. NaNs > can > > be troublesome for downstream code that might not notice until it gets > > confusing. A div-by-zero error is clear and easier to track down because > of > > the traceback. > > I'd much rather sanitize the inputs and tell the user they did something > bad than to have the script crash and give a 500 Internal Server Error to > the user. > Right, my advice was only good if the user can read the original error and traceback. And can restart the program, etc. Even worse, I definitely wouldn't want to give any hints of the source code > organization by letting the user see the traceback. > Depends on the kind of user you have. >
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Looking for feedback on weighted voting algorithm Michael Selik <michael.selik@gmail.com> - 2016-04-14 20:48 +0000
Re: Looking for feedback on weighted voting algorithm sohcahtoa82@gmail.com - 2016-04-15 10:52 -0700
Re: Looking for feedback on weighted voting algorithm Michael Selik <michael.selik@gmail.com> - 2016-04-16 00:35 +0000
csiph-web