[PATCH 1/2] [python] fix wrong check for list instance