verilog like class w/ bitslicing & int/long classtype

Jervis Whitley jervisau at gmail.com
Thu Jan 29 19:42:40 EST 2009


On Fri, Jan 30, 2009 at 9:02 AM, <mark.seagoe at 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,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090130/a29823d2/attachment.html>


More information about the Python-list mailing list