I guess you really want 

``weights = [decimal.Decimal(x) for x in ('0.2', '0.3', '0.5')]``

Without the quotes you will get ugly things.

BTW, I do not understand the comment: it says that numpy rejects the Decimal type but the computation below is done correctly(?)