|
From: David D. <nh...@gm...> - 2020-07-21 09:07:34
|
Thanks Luigi. Issue added on GitHub. On Tue, 21 Jul 2020 at 09:36, Luigi Ballabio <lui...@gm...> wrote: > Hello, > it's kind of forced on us by the need of virtual functions to have the > same return type. In C++ one can easily downcast the pointer to the > correct class again, but that doesn't carry well to Python. We should > override the method in the SWIG interface so it returns the more derived > type. May you open an issue on GitHub? > > Thanks, > Luigi > > > On Tue, Jul 21, 2020 at 1:14 AM David Duarte <nh...@gm...> wrote: > >> Hi all, >> >> In python, cloning an Ibor index seems to be a good way to assign a >> YieldTermStructure after it is created. >> >> For example: index.clone(yts) >> >> However this doesn't work with an overnight index because after cloning, >> the index type changes to IborIndex. >> >> For example, creating and index with ql.FedFunds() shows : >> >> <QuantLib.QuantLib.FedFunds; proxy of <Swig Object of type 'boost::shared_ptr< FedFunds > *' at 0x7f0706751a80> > >> >> >> But if I clone it, with ql.FedFunds().clone(yts), the instance changes to: >> >> >> <QuantLib.QuantLib.IborIndex; proxy of <Swig Object of type 'boost::shared_ptr< IborIndex > *' at 0x7f0706751de0> > >> >> >> Is this expected? >> >> >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |