Hey everybody! Sorry it's been a long time. I have some good news, though.
Dr. Scott Rixner of Rice University in Houston, TX, USA has been leading a project that uses and improves p14p.
Person:
http://www.cs.rice.edu/~rixner/
Slides:
https://www.usenix.org/sites/default/files/conference/protected-files/barr_atc12_slides.pdf
Presentation:
https://www.usenix.org/conference/usenixfederatedconferencesweek/design-and-implementation-embedded-python-run-time-system
Dr. Rixner donated a changeset that performs autoboxing. Autoboxing is a term that means, roughly, to turn a primitive type into an instance of an object wrapper class. What it means is you can now do this::
ipm> import list
ipm> l = [];
ipm> l.append(42)
ipm> l
[42]
Note that you MUST "import <type>" of whatever type you are boxing.
I just pushed this changeset to the default branch. I have enabled it for the posix64 and mbed platforms. If you want it on your platform, edit your platform's pmfeatures.py to set HAVE_AUTOBOX to True.
I am NOT going to push this changeset to the v10 branch because I plan to implement this in a more natural way. But it is perfectly possible for you to apply this changeset yourself if you need it. Details here:
http://code.google.com/p/python-on-a-chip/issues/detail?id=240
Autoboxing requires extra RAM to create the wrapper instance. So I only recommend using this feature if you have 16 KB or more of heap.
share and enjoy,
!!Dean
P.S. Here are the methods that are available:
ipm> import list
ipm> l = []; l.append(42)
ipm> l
[42]
ipm> l.extend([1,2,3,4])
ipm> l
[42, 1, 2, 3, 4]
ipm> l.append(42)
ipm> l.count(42)
2
ipm> l.index(3)
3
ipm> l.insert(0, "zero")
ipm> l
['zero', 42, 1, 2, 3, 4, 42]
ipm> l.pop()
42
ipm> l
['zero', 42, 1, 2, 3, 4]
ipm> l.remove(1)
ipm> l
['zero', 42, 2, 3, 4]
ipm> import dict
ipm> d = {}
ipm> d[0] = "zero"
ipm> d[1] = "one"
ipm> d[2] = "two"
ipm> d.keys()
[2, 1, 0]
ipm> d.has_key(0)
True
ipm> d.has_key(3)
False
ipm> d.has_key(None)
False
ipm> d.values()
['two', 'one', 'zero']
ipm> import string
ipm> s = "testing"
ipm> s.join(".")
't.e.s.t.i.n.g' # Bug: Inconsistent with CPython
ipm> s.count('t')
2
ipm> s.count('z')
0
ipm> s.find("t")
0
ipm> s.find("ti")
-1 # Bug: Inconsistent with CPython
ipm> s.find("i")
4