python equivalent of quote in lisp

functional-programming, lisp, python, quote

Solution

a = lambda: func(g)
g = something
a()

This isn't quite the most literal translation - the most literal translation would use a string and `eval` - but it's probably the best fit. Quoting probably isn't what you wanted in Lisp anyway; you probably wanted to `delay` something or create a `lambda`. Note that `func` and `g` are closure variables in the `lambda` function, rather than symbols, so if you call `a` from an environment with different bindings for `func` or `g`, it'll still use the variables from `a`'s environment of definition.

Problem

In python what is the equivalent of the quote operator? I am finding the need to delay evaluation. For example, suppose in the following lisp psuedocode I have: ``` a = '(func, 'g) g = something (eval a) ``` What I am doing is deferring evaluation of `g` till a later time. This is necessary because I want to define `g` later. What is the equivalent idea of this psuedocode in python?

Original source