[p4python] P4.Map differences

Vincent Batts vbatts at gmail.com
Tue Nov 22 09:17:16 PST 2011


Hello all,

I've found an inconsistency in P4 API (2010.1.260003) for Map, for
python (2010.1). I have checked the p4ruby library, and it does not
exist there. To see/reproduce the bug, run:
<paste>
>>> import P4
>>>
>>> cm = P4.Map()
>>> cm1 = cm.reverse()
>>>
>>> hasattr(cm, "includes")
True
>>> hasattr(cm1, "includes")
False
>>>
>>> type(cm)
<class 'P4.Map'>
>>> type(cm1)
<type 'P4API.P4Map'>
</paste>

For now, the workaround is:
cm1 = P4.Map(cm.reverse().as_array())

Take care,
vb
http://hashbangbash.com/



More information about the p4python mailing list