Re: [Tutor] Terminology question

2015-05-16 Thread Steven D'Aprano
On Sat, May 16, 2015 at 09:56:33AM -0700, Jim Mooney Py3.4.3winXP wrote: > def make_error(): > raise ZeroDivisionError('Here I am') > > def call_error(): > try: > make_error() > except: > print("How do I get the 'Here I am' message to print in the calling > routine?")

Re: [Tutor] Terminology question

2015-05-16 Thread Alan Gauld
On 16/05/15 17:56, Jim Mooney Py3.4.3winXP wrote: I can see I was marvelously unclear ;') Here is what I meant. def make_error(): raise ZeroDivisionError('Here I am') def call_error(): try: make_error() except: print("How do I get the 'Here I am' message to pri

Re: [Tutor] Terminology question

2015-05-16 Thread Jim Mooney Py3.4.3winXP
On 15 May 2015 at 22:45, Steven D'Aprano wrote: > > What does "didn't work" mean? Did your computer crash? Catch fire? A > completely different error got printed? Something else? I can see I was marvelously unclear ;') Here is what I meant. def make_error(): raise ZeroDivisionError('Here I

Re: [Tutor] Terminology question

2015-05-15 Thread Steven D'Aprano
On Thu, May 14, 2015 at 03:43:30PM -0700, Jim Mooney Py3.4.3winXP wrote: > I noticed that if I call a function that throws an error, I can catch it > from the caller, instead of catching it in the function. Is this is what is > known as "errors bubbling up?" Also, is this how you're supposed to do

Re: [Tutor] Terminology question

2015-05-15 Thread Steven D'Aprano
On Fri, May 15, 2015 at 12:02:44PM -0700, Jim Mooney Py3.4.3winXP wrote: > On 14 May 2015 at 16:47, Alan Gauld wrote: > > > Rather than printing the messages you could re-raise > > the error but with the error message attached as a string. > > > > I'm a little unclear how you catch the string yo

Re: [Tutor] Terminology question

2015-05-15 Thread Mark Lawrence
On 15/05/2015 20:02, Jim Mooney Py3.4.3winXP wrote: On 14 May 2015 at 16:47, Alan Gauld wrote: Rather than printing the messages you could re-raise the error but with the error message attached as a string. I'm a little unclear how you catch the string you create in a raise, in the caller.

Re: [Tutor] Terminology question

2015-05-15 Thread Jim Mooney Py3.4.3winXP
On 14 May 2015 at 16:47, Alan Gauld wrote: > Rather than printing the messages you could re-raise > the error but with the error message attached as a string. > I'm a little unclear how you catch the string you create in a raise, in the caller. I tried an example from the docs but it didn't work

Re: [Tutor] Terminology question

2015-05-14 Thread Ben Finney
"Jim Mooney Py3.4.3winXP" writes: > I noticed that if I call a function that throws an error (Known in Python as “raise an exception”. I understood you, but it's better to use the terminology that matches what the Python docs say.) > I can catch it from the caller, instead of catching it in the

Re: [Tutor] Terminology question

2015-05-14 Thread Alan Gauld
On 14/05/15 23:43, Jim Mooney Py3.4.3winXP wrote: I noticed that if I call a function that throws an error, I can catch it from the caller, instead of catching it in the function. Is this is what is known as "errors bubbling up?" Yes. They can bubble up naturally because there are no handlers l

[Tutor] Terminology question

2015-05-14 Thread Jim Mooney Py3.4.3winXP
I noticed that if I call a function that throws an error, I can catch it from the caller, instead of catching it in the function. Is this is what is known as "errors bubbling up?" Also, is this how you're supposed to do it? *** Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600

Re: [Tutor] terminology question

2005-08-02 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Quoting Dick Moores <[EMAIL PROTECTED]>: > > >>Why are list comprehensions called that? > > > Because that's what they're called in Haskell, I guess.. > > It's historical, based on the term "set comprehension" from mathematics, also > known as "set builder notation":

Re: [Tutor] terminology question

2005-08-01 Thread Dick Moores
[EMAIL PROTECTED] wrote at 21:52 8/1/2005: >Quoting Dick Moores <[EMAIL PROTECTED]>: > > > Why are list comprehensions called that? > >Because that's what they're called in Haskell, I guess.. This Haskell, I suppose? >It's historical, ba

Re: [Tutor] terminology question

2005-08-01 Thread jfouhy
Quoting Dick Moores <[EMAIL PROTECTED]>: > Why are list comprehensions called that? Because that's what they're called in Haskell, I guess.. It's historical, based on the term "set comprehension" from mathematics, also known as "set builder notation": http://en.wikipedia.org/wiki/Set_comprehensi

[Tutor] terminology question

2005-08-01 Thread Dick Moores
Why are list comprehensions called that? Thanks, Dick Moores [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor