[master 5/5] Simplify StorageDevice.disks.

mulkieran installerbot-noreply at redhat.com
Wed Mar 4 13:28:11 UTC 2015


In reply to line 160 of blivet/devices/storage.py:

_disks = [SAME HERE] would be prettier, but it doesn't work because Python doesn't allow that kind of recursive definition.
_disks = []
_disks = [SAME HERE]
also wouldn't work because [SAME HERE] would be evaluated in terms of _disks as [], you need a generator comprehension to evaluate in terms of updated version of _disks.

You're right that I could squish the whole for loop into a single list comprehension. I thought about doing that, but I think this version is easier to read for most people.

-- 
To view this comment on github, visit https://github.com/mulkieran/blivet/commit/06342f7063698808c24d47df92f6ee19ac8e3c87#commitcomment-10029124


More information about the anaconda-patches mailing list