FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 06-20-2012, 05:44 PM
David Lehman
 
Default Implement Size.__radd__ so sum works with Size instances.

---
pyanaconda/storage/size.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/storage/size.py b/pyanaconda/storage/size.py
index 865634c..1906ee0 100644
--- a/pyanaconda/storage/size.py
+++ b/pyanaconda/storage/size.py
@@ -148,6 +148,10 @@ class Size(Decimal):
def __add__(self, other):
return Size(bytes=Decimal.__add__(self, other))

+ # needed to make sum() work with Size arguments
+ def __radd__(self, other):
+ return Size(bytes=Decimal.__radd__(self, other))
+
def __sub__(self, other):
return Size(bytes=Decimal.__sub__(self, other))

--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 11:16 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org