I did think about that - but it worked in practice so I left it. However, you are probably right that we should ensure against a change in Python in the future creating a bug. I will think again about how to code this efficiently.