http://quantlib.414.s1.nabble.com/QuantLib-SWIG-as-coupon-and-friends-in-Python-tp15935p15936.html
> Dear list,
>
> I seem to be having a problem using the as_coupon() SWIG function in
> Python.
>
> I've tested this using QuantLib revision
> 88aedbaf615de99143c71126dbd92827c3fff96f from May 27.
>
> Some pseudo-code for illustration:
>
> import QuantLib as QL
>
> ... create a FixedRateBond ...
>
> bond = QL.FixedRateBond(...)
> for cashflow in bond.cashflows():
> coupon = QL.as_coupon(cashflow)
> print "Date: " + str(coupon.date()) + \
> ", Amount: " + str(coupon.amount()) + \
> ", Accrual period: " + str(coupon.accrualPeriod())
>
> This fails with:
>
> File "/usr/local/lib/python2.7/dist-packages/QuantLib/QuantLib.py",
> line 6271, in amount
> def amount(self): return _QuantLib.CashFlow_amount(self)
> RuntimeError: Boost assertion failed: px != 0
>
> Other methods (like coupon.accrualPeriod()) fail in a similar manner.
>
> Thanks,
> Pascal
>
> ------------------------------------------------------------------------------
> Slashdot TV. Videos for Nerds. Stuff that Matters.
>
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk> _______________________________________________
> QuantLib-users mailing list
>
[hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quantlib-usersSlashdot TV. Videos for Nerds. Stuff that Matters.