Skip to content Skip to sidebar Skip to footer
Showing posts with the label Metaprogramming

Detecting Infinite Recursion

I'm creating a macro for Trac, and one of the things it does is to render a bit of wiki text, t… Read more Detecting Infinite Recursion

Equivalent Of Python Eval In Haskell

There is function in python called eval that takes string input and evaluates it. >>> x = … Read more Equivalent Of Python Eval In Haskell

Self Decompressing And Executing Code In Python

This is the code that creates a compressed file with arbitrary python code in it. The idea is that … Read more Self Decompressing And Executing Code In Python

Dynamically Decorate A Function Inside A Class In Python3

This is an extension of Dynamic/runtime method creation (code generation) in Python @John Montgomme… Read more Dynamically Decorate A Function Inside A Class In Python3

Subclass __module__ Set To Metaclass Module When Manually Creating New Class With Type()

In the following example, the newly created subclass ends up being the metaclass __module__ rather … Read more Subclass __module__ Set To Metaclass Module When Manually Creating New Class With Type()