Re: [Tutor] please return flys in ointment

2013-07-08 Thread Steven D'Aprano
Comments on your code inline below. On Sat, Jul 06, 2013 at 02:38:27PM -0700, Jim Mooney wrote: > import sys > > # Data > ones = {'1': 'one', '2': 'two', '3': 'three', '4': 'four', '5': 'five', > '6': 'six', '7': 'seven', '8': 'eight', '9': 'nine'} > > tens = {'2': 'twenty', '3': 'thirty', '4'

Re: [Tutor] please return flys in ointment

2013-07-08 Thread Jim Mooney
On 8 July 2013 00:12, Steven D'Apranocatching ArithmeticError > further on), please use a custom exception > Well, an Arithmetic Error was better than bubbling up to a totally general one. I'm not sure how do custom error code. Short example, please ;') Jim __

Re: [Tutor] please return flys in ointment

2013-07-08 Thread Dave Angel
On 07/08/2013 01:57 PM, Jim Mooney wrote: On 8 July 2013 00:12, Steven D'Apranocatching ArithmeticError further on), please use a custom exception Well, an Arithmetic Error was better than bubbling up to a totally general one. I'm not sure how do custom error code. Short example, please ;')

Re: [Tutor] please return flys in ointment

2013-07-08 Thread Jim Mooney
> To make a custom error, first pick another error that's a superset of what > you're doing. Then simply derive your error class from it. As a minimum: > > class TooHugeError (ValueError): > pass > > Actually, I didn't get to classes yet since I wanted to nail procedural - I'm in no rush - bu

Re: [Tutor] AMQP listening and user-facing daemon

2013-07-08 Thread Alan Gauld
On 07/07/13 22:57, Justin Chiu wrote: What is the best approach to writing a concurrent daemon that can execute callbacks for different types of events (AMQP messages, parsed output of a subprocess, HTTP requests)? Given nobody replied to your previous request I suggest you try another forum.

Re: [Tutor] custom error classes: how many of them does one need?

2013-07-08 Thread Dave Angel
On 07/08/2013 04:51 PM, Albert-Jan Roskam wrote: haha, I hadn't even noticed the 'speling eror'. I was just thinking 'what the heck is a desert spoon'? ;-) "A dessert spoon is a spoon designed specifically for eating dessert and sometimes used for soup or cereals." On the other hand,

Re: [Tutor] custom error classes: how many of them does one need?

2013-07-08 Thread Alan Gauld
On 08/07/13 21:51, Albert-Jan Roskam wrote: I was just thinking 'what the heck is a desert spoon'? ;-) It's the one half-way between a teaspoon and a tablespoon :-) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tuto

Re: [Tutor] custom error classes: how many of them does one need?

2013-07-08 Thread Marc Tompkins
On Mon, Jul 8, 2013 at 1:51 PM, Albert-Jan Roskam wrote: > haha, I hadn't even noticed the 'speling eror'. I was just thinking 'what > the heck is a desert spoon'? ;-) > Many years ago, I saw this painted on the side of a pie shop: "My favorite people are the people of the dessert", said Lawrenc

Re: [Tutor] please return flys in ointment

2013-07-08 Thread Steven D'Aprano
On 09/07/13 05:47, Dave Angel wrote: On 07/08/2013 01:57 PM, Jim Mooney wrote: On 8 July 2013 00:12, Steven D'Apranocatching ArithmeticError further on), please use a custom exception Well, an Arithmetic Error was better than bubbling up to a totally general one. I'm not sure how do custom

Re: [Tutor] please return flys in ointment

2013-07-08 Thread Steven D'Aprano
On 09/07/13 05:59, Jim Mooney wrote: To make a custom error, first pick another error that's a superset of what you're doing. Then simply derive your error class from it. As a minimum: class TooHugeError (ValueError): pass Actually, I didn't get to classes yet since I wanted to nail proc