python bytecode compatibility

时光毁灭记忆、已成空白 提交于 2019-12-01 11:59:55

Python makes no guarantee about bytecode compatibility between versions. Don't rely on it.

In fact, a pyc file starts with a magic number that changes every time the marshalling code does, and python checks this number for compatibility. Since this code changes pretty much every version, so does the magic number. See Ned Batchelder's blog entry for details.

There are better ways of ensuring your files haven't been tampered with: checksums, for example.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!