Re: [Tutor] Please review my code

2011-09-16 Thread Emeka
Hello Alan, My bad, I have added the missing folder. To all, please make out time and review my code. I would like to have your comments. https://github.com/janus/Text-Twist Regards, emeka On Fri, Sep 16, 2011 at 1:20 PM, R. Alan Monroe wrote: > > > It was only tested on a Windows Box, but I

Re: [Tutor] Strange zip syntax

2011-09-16 Thread Emeka
iBrett, iter On Fri, Sep 16, 2011 at 3:35 AM, Brett Ritter wrote: > I ran into this article ( > http://blog.adku.com/2011/09/hodgepodge-of-python.html ) and found > myself temporarily stymied by one line it in: > > zip(*[iter(a)]*2) > > Used like this: > > >>> a = ['a','1','b','2','c','3'] > >>

Re: [Tutor] Strange zip syntax

2011-09-16 Thread Albert-Jan Roskam
Hi,   I would write the slightly longer, but more readable (for me at least) code: >>> a = ['a','1','b','2','c','3'] >>> [(a[i], a[i+1]) for i in range(0, len(a), 2)] [('a', '1'), ('b', '2'), ('c', '3')] >>> zip(*[iter(a)]*2) [('a', '1'), ('b', '2'), ('c', '3')]   And it's also faster:   >>> import

Re: [Tutor] Please review my code

2011-09-16 Thread R. Alan Monroe
> It was only tested on a Windows Box, but I see no reason why it would not > work on Unix family. https://github.com/janus/Text-Twist > I need you comments. I think you forgot to upload some needed images along with the python code: ['abase', 'abased', 'abed', 'ads', 'baa', 'baas', 'bad', 'bade

Re: [Tutor] If statement optimization

2011-09-16 Thread bodsda
Thanks for the explanation - very clear. Cheers, Bodsda Sent from my BlackBerry® wireless device -Original Message- From: Steven D'Aprano Sender: tutor-bounces+bodsda=googlemail@python.org Date: Fri, 16 Sep 2011 20:43:45 To: Tutor - python List Subject: Re: [Tutor] If statement opt

Re: [Tutor] If statement optimization

2011-09-16 Thread Steven D'Aprano
bod...@googlemail.com wrote: Hi, In a normal if,elif,elif,...,else statement, are the conditions checked in a linear fashion? Yes. I am wondering if I should be making an effort to put the most likely true condition at the beginning of the block Probably not. The amount of time used in

[Tutor] If statement optimization

2011-09-16 Thread bodsda
Hi, In a normal if,elif,elif,...,else statement, are the conditions checked in a linear fashion? I am wondering if I should be making an effort to put the most likely true condition at the beginning of the block Thanks, Bodsda Sent from my BlackBerry® wireless device _

Re: [Tutor] What's the keyword for the Python creed?

2011-09-16 Thread Richard D. Moores
On Thu, Sep 15, 2011 at 23:47, Christian Witts wrote: > from __future__ import braces Ha! (2.7 and 3.x) Dick ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor