Extending Python
摘要
You can implement anything in Python, really; it’s a powerful language, but sometimes it can get a bit too slow. For example, if you’re writing a scientific simulation of some form of nuclear reaction or you’re rendering the graphics for the next Star Wars movie, writing the high-performance code in Python will probably not be a good choice. Python is meant to be easy to work with and to help make the development fast. The flexibility needed for this comes with a hefty price in terms of efficiency. It’s certainly fast enough for most common programming tasks, but if you need real speed, languages such as C, C++, Java, or Julia can usually beat it by several orders of magnitude.