oship-dev team mailing list archive
-
oship-dev team
-
Mailing list archive
-
Message #00072
Re: OSHIP Rev 224 Code Review: issue #04 - Replace while x<n loop by pythonic for item in vocab loop
Okay, so I first started programming in 1976.
As I recall, in this area there was an issue with knowing (in advance)
how big the terminology was, what the keys were to be used and something
else. Anyway, the 'break' didn't work as expected in the 'for'
construct (as Roger suggests) when I started with that. Maybe it was my
implementation? Just some things to think about. I'd be happy to look
at this again and discuss it with the person that takes it on to clean
it up a bit.
--Tim
On Tue, 2009-03-24 at 14:11 +0100, Roger Erens wrote:
> In app.py the Import<terminology> view classes use a C-like construct
>
> n=len(vocab)
> x=0
> while x<n:
> <add the term to the container>
> x+=1
>
> which IMHO could be replaced by
>
> for term in vocab:
> <add term to the container>
>
>
> Optionally use enumerate() in order to obtain an index that can be used
> to show the progress of the importing in an AJAX-like widget.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~oship-dev
> Post to : oship-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~oship-dev
> More help : https://help.launchpad.net/ListHelp
--
Timothy Cook, MSc
Health Informatics Research & Development Services
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
Skype ID == timothy.cook
**************************************************************
*You may get my Public GPG key from popular keyservers or *
*from this link http://timothywayne.cook.googlepages.com/home*
**************************************************************
Attachment:
signature.asc
Description: This is a digitally signed message part
References