Origen-SDK / o2

MIT License
4 stars 0 forks source link

Fix sub-block iteration #66

Closed ginty closed 4 years ago

ginty commented 4 years ago

Quick for for issue with sub-block iteration noted in #61 discussion

info-rchitect commented 4 years ago

@ginty Thanks for the quick PR. What is the difference between _dict and __dict__?

info-rchitect commented 4 years ago

@ginty will this fix then enable the same pattern of iteration for regs, memory maps, and address blocks if ported to registers.py?

ginty commented 4 years ago

I think there is no difference between _dict and dict, but I found a comment somewhere when trying to work out wtf was going on that mentioned that dict was used by Python (to store metadata) so I changed it to avoid clashing with that.

Made no difference though, the missing iter method was the key.

Oh to be back in Ruby land when all something like would take is class Proxy < Hash

ginty commented 4 years ago

This will have no effect on any other iterators, this is purely for the sub_blocks. All the others are implemented in Rust, but sub-blocks are uniquely done in Python because that's where a lot of the user application code will go.