What does “i” represent in Python .pyi extension?

前端 未结 3 1183
时光取名叫无心
时光取名叫无心 2020-12-13 01:42

In Python, what does \"i\" represent in .pyi extension?

In PEP-484, it mentions .pyi is \"a stub file\" but no mnemonic help on the extension. So does the \"i\" mea

3条回答
  •  盖世英雄少女心
    2020-12-13 02:12

    The i in .pyi stands for ‘interface’.

    The .pyi extension was first mentioned in this GitHub issue thread where JukkaL says:

    I'd probably prefer an extension with just a single dot. It also needs to be something that is not in use (it should not be used by cython, etc.). .pys seems to be used in Windows (or was). Maybe .pyi, where i stands for an interface definition?

提交回复
热议问题