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

2005-12-06 Thread david
thanks for tries and bisect. this led me to the wikipedia article http://en.wikipedia.org/wiki/Search_algorithm which was where i was looking to start. so, i think the simplest approach to search through a short list would be a brute force algorithm. like so :   get a letter and compare it to

Re: [Tutor] terminology

2005-12-05 Thread Danny Yoo
> > suppose you have a list of words and you want to unambiguously identify > > each word in the list with the shortest number of characters. > > for instance a list like : kill, kiss, take > > i would want to get take just by typing t. > > but you would have to type kil or kis to get kill or kiss

Re: [Tutor] terminology

2005-12-05 Thread John Fouhy
On 06/12/05, david <[EMAIL PROTECTED]> wrote: > suppose you have a list of words and you want to unambiguously identify > each word in the list with the shortest number of characters. > for instance a list like : kill, kiss, take > i would want to get take just by typing t. > but you would have to

[Tutor] terminology

2005-12-05 Thread david
suppose you have a list of words and you want to unambiguously identify each word in the list with the shortest number of characters. for instance a list like : kill, kiss, take i would want to get take just by typing t. but you would have to type kil or kis to get kill or kiss. where shoul

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

Re: [Tutor] Terminology WAS Whats so good about OOP ?

2005-03-13 Thread Danny Yoo
> > > > Where I come from, the output of a function is determined by the input > > to the function. > > Well, actually, your being upset at that is the exact point of > functional programming languages: in functional programming, the output > of a function is determined by its input, and *

Re: [Tutor] Terminology WAS Whats so good about OOP ?

2005-03-13 Thread Max Noel
On Mar 13, 2005, at 18:38, Brian van den Broek wrote: Thanks for the explanation, Sean. The reference to grammatical theory here does seem to make sense. But, relying on correspondence between the technical terms in programming/comp. sci. and other fields with similar terminology can get in the

[Tutor] Terminology WAS Whats so good about OOP ?

2005-03-13 Thread Brian van den Broek
Sean Perry said unto the world upon 2005-03-13 02:49: Brian van den Broek wrote: 1) Namespace issues With procedural (or imperative -- don't know which is the right terms for non-OOP code which employs functions) code, you can have issues caused by namespaces. Just yesterday, someone on the main py