On 8/16/13 5:34 PM, Jason Grout wrote:
entries=dict([(e[0],e[1].n(prec, digits)) for e in
self._entries.iteritems()])
if len(self)-1 not in entries:
     entries[len(self)-1]=0
vector(entries, sparse=True)


It could be shortened by using the setdefault method:

entries=dict([(e[0],e[1].n(prec, digits)) for e in self._entries.iteritems()])
entries.setdefault(len(self)-1, 0)
vector(entries, sparse=True)

Thanks,

Jason


--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to