Not to be nit-picky but it's still not the same. The switch would give no output but yours would give a newline. I think the sys write solution would be the closest equivalent...and took a lot longer for us to code correctly :-)
Jeff -----Original Message----- From: Alan Gauld [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 1:24 PM To: Smith, Jeff; Bob Gailer; tutor@python.org Subject: Re: [Tutor] Are you allowed to shoot camels? [kinda OT] > That's no good. You still get something printed out. In this case: > > None Of course, silly me, p will return the default value None, you need to replace the pass with return '' or, I guess use the lambda... > ftable = { 'a' : lambda: 'a',... > 'd' : lambda: ''} Now it should work and is consistent again! But only for this trivial case of printing a label... Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor