Reasoning behind `from … import …` syntax in Python

后端 未结 8 1542
刺人心
刺人心 2020-12-18 20:35

I always wondered why the syntax for importing specific objects from a module is from module import x, y, z instead of import x, y, z from module.

8条回答
  •  借酒劲吻你
    2020-12-18 21:24

    A very wild guess and probably totally non-sense, but I knew that syntax from Modula-2 (man, that was twenty years ago, I feel old)... maybe Python was inspired by it ?

提交回复
热议问题