Integrating External Code

  • Reuse rather than rewrite. However, if existing code is not up to scratch, rewrite is sometimes faster than fixing (but usually is a last resort).

  • Lots of existing code already has Python bindings. For those that do not, writing some is usually not too hard. A little time consuming sometimes, but not brain surgery.

  • Sometimes requires deep understanding of what is being wrapped and where things can go wrong. Memorable cases:

    • X.25 socket-like module.

    • SSL module.