wiki:Notes/PythonMetaProgramming

Python Meta-Programming

A starter page, needs tighter definitions. Relevance ?

A fairly specialized and obscure subject ... until the advent of Python3.

https://en.wikipedia.org/wiki/Metaprogramming

Metaprogramming is the writing of computer programs with the ability to treat programs as their data. It means that a program could be designed to read, generate, analyse or transform other programs, and even modify itself while running ...

Why do that ? After some extra work on the front end, it makes it easier to extend and customize program behavior in the long run ... one hopes.

https://en.wikipedia.org/wiki/Category:Metaprogramming

From the Python Cookbook, mostly Python3.

http://chimera.labs.oreilly.com/books/1230000000393/ch09.html#_discussion_150

... In Python, such problems are often solved under the category of "metaprogramming." In a nutshell, metaprogramming is about creating functions and classes whose main goal is to manipulate code (e.g., modifying, generating, or wrapping existing code).

The main features for this include decorators, class decorators, and metaclasses. However, a variety of other useful topics—including signature objects, execution of code with exec(), and inspecting the internals of functions and classes—enter the picture. ...

http://python-3-patterns-idioms-test.readthedocs.io/en/latest/Metaprogramming.html

http://eli.thegreenplace.net/2011/08/14/python-metaclasses-by-example - Python 2.7

Also See

What are the different 'types' of programming ? Object-oriented, aspect oriented, whatever oriented, etc. etc.

https://en.wikipedia.org/wiki/Programming_paradigm

In computer programming, the notion of programming paradigms can have somewhat different meanings depending on its context of use ... Involving ...

As soon as I hear a definition that includes the words 'involving blah blah', I know I'm in trouble !

https://en.wikipedia.org/wiki/Comparison_of_programming_paradigms

https://en.wikipedia.org/wiki/Category:Programming_paradigms

https://en.wikipedia.org/wiki/Functional_programming

... functional programming is a programming paradigm—a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. It is a declarative programming paradigm, which means programming is done with expressions or declarations instead of statements ...

Seems to be some sort of overlap with meta-programming, but not clear what.

Last modified 18 months ago Last modified on 06/05/2016 03:01:32 PM