Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #103743 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2016-03-01 04:38 +1100 |
| Last post | 2016-03-01 23:05 +1100 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: usage of try except for review. Chris Angelico <rosuav@gmail.com> - 2016-03-01 04:38 +1100
Re: usage of try except for review. Steven D'Aprano <steve@pearwood.info> - 2016-03-01 23:05 +1100
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2016-03-01 04:38 +1100 |
| Subject | Re: usage of try except for review. |
| Message-ID | <mailman.31.1456767509.20602.python-list@python.org> |
On Tue, Mar 1, 2016 at 4:34 AM, Ganesh Pal <ganesh1pal@gmail.com> wrote: > On Mon, Feb 29, 2016 at 10:10 PM, Dennis Lee Bieber > <wlfraed@ix.netcom.com> wrote: > >> Ask yourself: Will my program still work if I remove all the assert >> statements. If the answer is "No", then you should not be using an assert. > > You meant if the answer is "NO" then I should be using asset ? No, Dennis was correct. You should assume that "assert" can potentially be replaced with "pass" and your program will continue to work. ChrisA
[toc] | [next] | [standalone]
| From | Steven D'Aprano <steve@pearwood.info> |
|---|---|
| Date | 2016-03-01 23:05 +1100 |
| Message-ID | <56d58598$0$1601$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #103743 |
On Tue, 1 Mar 2016 04:38 am, Chris Angelico wrote: > On Tue, Mar 1, 2016 at 4:34 AM, Ganesh Pal <ganesh1pal@gmail.com> wrote: >> On Mon, Feb 29, 2016 at 10:10 PM, Dennis Lee Bieber >> <wlfraed@ix.netcom.com> wrote: >> >>> Ask yourself: Will my program still work if I remove all the >>> assert >>> statements. If the answer is "No", then you should not be using an >>> assert. >> >> You meant if the answer is "NO" then I should be using asset ? > > No, Dennis was correct. You should assume that "assert" can > potentially be replaced with "pass" and your program will continue to > work. http://import-that.dreamwidth.org/676.html -- Steven
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web