[Yum-devel] RPMDBPackageSack cleanup

Tim Lauridsen tim at rasmil.dk
Wed Sep 13 06:54:01 UTC 2006


seth vidal wrote:
> On Tue, 2006-09-12 at 09:05 +0100, Menno Smits wrote:
>   
>> seth vidal wrote:
>>     
>>> so does writing it all in C and yet both of those things make it harder
>>> and harder to read.
>>>
>>> I seriously cannot be the only person who thinks filters, lambdas and
>>> list comprehensions are harder to read, can I?
>>>       
>> I agree that filters and lambdas are generally harder to read. List 
>> comprehensions can be a little trickier but I think they are generally 
>> quite clear. Like I said earlier, it's a matter of personal taste.
>>
>> To clarify, I didn't use list comprehensions in rpmsack.py for speed 
>> reasons. I find them to be a concise, clear way of expressing simple 
>> list building operations.
>>
>> Obviously not everyone agrees that list comprehensions are as clear as I 
>> do and easily-understood code is important in any open source project if 
>> you want people to contribute. I think I'll change the list comps and 
>> avoid using them in yum code in the future.
>>     
>
> no, if I'm alone on my thinking on the list comps then go with them.
> I'll just get used to them.
>
> -sv
>   
Then i first time read about list comprehensions in "Dive into Python", 
I had a hard time get along with
them.

http://diveintopython.org/power_of_introspection/index.html#apihelper.divein

But now i have get used to them, so it more clear to me. But they have 
to be used with care and only to do simple stuff. Not for the old 'C' 
way, of how much code and complexity can i put into at single line.

I agree with the filter and lamba stuff is very powerful, but make the 
code very hard to read and even harder to debug.

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.baseurl.org/pipermail/yum-devel/attachments/20060913/15d417b2/attachment.htm 


More information about the Yum-devel mailing list