Message61149
Logged In: YES
user_id=80475
FTI, there was a related feature request,
www.python.org/sf/846568 for treating numbers as bitarrays.
As proposed, it was invalid because numbers in Python are
immutable (no bit assignments allowed).
That could be combined with this idea generic numeric
register class that optionally specifies size (if bound),
base, endianess, etc.
bcdreg = register(places=5, base=10)
bcdreg.assign(697)
bcdreg[-1] --> 7
bcdreg.multiply(1000) --> 97000
None of this is for the mainstream user and it would be
unlikely to ever be included in the standard library. The
best approach would be to experiment with an API in pure
python, perhaps publish it as a recipe, and if it is well
received, put a C version on the vaults of parnassus.
|
|
Date |
User |
Action |
Args |
2008-01-20 09:59:32 | admin | link | issue887237 messages |
2008-01-20 09:59:32 | admin | create | |
|