[python] add chain inspection