In addition to the index/particle split, I don't think "is" works reliably with swig objects as identity can get lost when you pass through C++.