IronPythonScript: unexpected token 'from'

This is my code:

import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
from itertools import *
import itertools as it

# 该节点的输入内容将存储为 IN 变量中的一个列表。
dataEnteringNode = IN

lst = IN[0]
index = IN[1]
def combos(d):
   if not isinstance(d, list):
      yield d
   else:
      for i in it.permutations(d):
         yield from map(list, it.product(*[combos(j) for j in i]))

res = list(combos(lst))
res_index = res[index]

OUT = res_index

When I tried to run the code, the system said: IronPythonScript: unexpected token ‘from’.

Hello @202003021021 and welcome

yield from expression is a Python 3.3 feature, you can’t use it in IronPython 2.7

6 Likes