Chapter 14. Extending IronPython with C#/VB.NET

This chapter covers

  • Creating class libraries for IronPython

  • .NET attributes and IronPython

  • Calling unmanaged code with P/Invoke

  • Creating dynamic objects with C#/VB.NET

  • Compiling assemblies at runtime

There is a standard mantra about performance when programming with Python (CPython). The mantra goes something like this: “Code in Python first; then profile and optimize your bottlenecks. Finally, if you still need your code to run faster, rewrite the performance-sensitive parts of your code in C.” Okay, as mantras go there are probably snappier ones, but it still contains a lot of wisdom. Of course, with IronPython we wouldn’t drop down to C[1] but into C# or VB.NET instead.

This is an area where IronPython ...

Get IronPython in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.