Duncan Booth wrote:
>for item in list:
>    if item == 'searched.domain':
>        return item...


[EMAIL PROTECTED] wrote:
>Sure, but I have two options here, none of them nice: either "write C
>in Python" or do it inefficient and still elaborate way.

I don't understand your point at all.  How does the above code equate to
writing C in Python?  Personally, I don't think that reading an entire file,
hashing its values into a dictionary just to be able to pull out one using a
dictionary get is very pythonic.  Python is about keeping things simple and
clear. Sometimes that's at the cost of efficiency but simplicity and clarity
are paramount.  Making things more complicated and much harder for others to
follow is very un-pythonic IMO.  In this case, having a simple solution
that's also much more efficient is a bonus.


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to