Re: [myhdl-list] difficulty using itertools with MyHDL
Brought to you by:
jandecaluwe
From: George P. <ge...@ga...> - 2006-10-20 03:11:32
|
George Pantazopoulos wrote: > Hi Jan, > > I'm having difficulty using itertools objects in MyHDL simulations. > It seems this is the case because, from some crazy reason, the Python > itertools objects are *not* of type GeneratorType! In fact, it looks > like each one is its own type! (eg itertools.izip, itertools.chain). > > This causes myhdl._Simulation._checkArgs to raise an "Inappropriate > Argument Type" SimulationError. > > I'd really like to be able to use itertools.izip() and > itertools.chain() at least. What could be done about the situation? Is > there anyway to "coerce" the iterools into GeneratorTypes? > > Thanks, > I found an interesting article on doing type checking in Python: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/305888 I'm not sure, but perhaps you could check for generator-like behavior (eg. a 'next' function) and not GeneratorType directly? Thanks, George |