> On 2010-06-28 17:41:44, Nathan Binkert wrote:
> > src/python/m5/SimObject.py, line 767
> > <http://reviews.m5sim.org/r/27/diff/2/?file=615#file615line767>
> >
> >     I wonder if Children doesn't quite describe it right since children 
> > doesn't obviously imply recursion.  iterDescendants?  (I don't have strong 
> > feelings here.)

I don't disagree, but don't have a lot of great alternatives.  iterDescendants 
is too long.  iterTree?


> On 2010-06-28 17:41:44, Nathan Binkert wrote:
> > src/python/m5/SimObject.py, line 773
> > <http://reviews.m5sim.org/r/27/diff/2/?file=615#file615line773>
> >
> >     Not sure if it is worth it, but we could add the following to 
> > __getattr__(self, attr):
> >     
> >     try:
> >         return getattr(self._ccObject, attr)
> >     except AttributeError:
> >         pass
> >     
> >     There are two failures, _ccObject doesn't exist yet, and attr is not 
> > found.  I think both are handled by AttributeError.  Anyway it's just an 
> > idea since the code looks repetitive.  Could also do:
> >     if attr in ('init', 'regStats' .....):
> >        return getattr(self._ccObject, attr)
> >     
> >     Just less code and I know that you like less code :)

Sounds good to me... I'll give it a try.


- Steve


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviews.m5sim.org/r/27/#review53
-----------------------------------------------------------


On 2010-06-27 23:41:59, Steve Reinhardt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviews.m5sim.org/r/27/
> -----------------------------------------------------------
> 
> (Updated 2010-06-27 23:41:59)
> 
> 
> Review request for Default.
> 
> 
> Summary
> -------
> 
> sim: move iterating over SimObjects into Python.
> 
> 
> Diffs
> -----
> 
>   src/python/m5/SimObject.py 5044bb906d5a 
>   src/python/m5/core.py 5044bb906d5a 
>   src/python/m5/simulate.py 5044bb906d5a 
>   src/python/m5/stats.py 5044bb906d5a 
>   src/python/swig/core.i 5044bb906d5a 
>   src/python/swig/pyobject.hh 5044bb906d5a 
>   src/python/swig/sim_object.i 5044bb906d5a 
>   src/sim/sim_object.hh 5044bb906d5a 
>   src/sim/sim_object.cc 5044bb906d5a 
> 
> Diff: http://reviews.m5sim.org/r/27/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Steve
> 
>

_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to