[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] pygrub patch to allow explicit offset to fs



On Wed, Jun 19, 2013 at 09:44:46AM +0100, Ian Campbell wrote:
> On Wed, 2013-06-19 at 09:39 +0100, Wei Liu wrote:
> > On Wed, Jun 19, 2013 at 09:17:30AM +0100, Ian Campbell wrote:
> > > On Wed, 2013-06-19 at 01:40 +0200, Kjetil Torgrim Homme wrote:
> > > >      # get list of offsets into file which start partitions
> > > > -    part_offs = get_partition_offsets(file)
> > > > +    if user_provided_offset is None:
> > > > +        part_offs = get_partition_offsets(file)
> > > > +    else:
> > > > +        part_offs = [ int(user_provided_offset) ]
> > > 
> > > Then this can become just:
> > >      if part_offs = None:
> > 
> > You do know you missed a "=" here, right? :-)
> 
> I claim pseudo-code ;-)

Comparisons with None should be done with "is" and "is not".

http://www.python.org/dev/peps/pep-0008/
  Comparisons to singletons like None should always be done with is or
  is not, never the equality operators.

Matt

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.