What is the precedence of python compiled files in imports?

前端 未结 1 1081
忘掉有多难
忘掉有多难 2020-12-16 19:09

Python files are compiled to bytecode (*.pyc).

Using Cython you can compile them to machine code (*.so in Linux).

If you use have both files in the same fol

相关标签:
1条回答
  • 2020-12-16 19:50

    Python will load the .so file first. See this question for an ordered list of the suffixes that python searches for.

    Well, I'll just tell you:

    foo (a directory)
    foo.so
    foomodule.so
    foo.py
    foo.pyc
    
    0 讨论(0)
提交回复
热议问题