[PATCH 4/5] Change management of Device parents to use a simple list interface.

David Lehman dlehman at redhat.com
Tue Mar 25 15:43:00 UTC 2014


On Tue, 2014-03-25 at 09:47 -0500, David Lehman wrote:
> On Tue, 2014-03-25 at 11:21 +0100, Vratislav Podzimek wrote:
> > On Mon, 2014-03-24 at 13:50 -0500, David Lehman wrote:
> > > +        """
> > > +        args = []
> > > +        if items:
> > > +            args.append(items)
> > > +
> > > +        self.items = list(*args)
> > I believe that these 5 lines can be replaced by simple
> > 
> >     if items:
> >         self.items = list(items)
> > 
> > because the parameter is required to be an iterable.
> 
> It is also optional, and list(None) raises a TypeError.

I didn't read what you wrote carefully enough -- ignore my initial
response.

It would need to initialize self.items even if items were None, but your
approach is still simpler. I'll change it. Thanks.



More information about the anaconda-patches mailing list