On Fri, Jan 30, 2009 at 9:02 AM, <mark.sea...@gmail.com> wrote: > I'm trying to make a script environment with datatypes (or classes) > for accessing hardware registers. At the top level, I would like the > ability to bitwise ops if bit slice brackets are used, but if no > brackets are used, I would like it to write/read the whole value. > > For example, if I have something like: > > >>> shadow_register = MyRegClass(0xAA) > >>> shadow_register >
is it so bad to type: >>> shadow_register[:] 170 ?? I like this because it is quite clear as to what you are doing, and is consistent with the bit slicing you have (already) implemented. Cheers,
-- http://mail.python.org/mailman/listinfo/python-list