symbolic python

François Pinard pinard at iro.umontreal.ca
Sat May 25 12:53:56 EDT 2002


[Benjamin Tai]

> Hi, Can Python behave as a symbolic language, like... Prolog?  For example,
> if I define a function:

> def fun():
>     #function_body

> Is there any chance to print out the code inside the function_body?
> When I receive a method object, would it be possible to get into the
> function_body, and dynamically change the method's behaviour?

Hi, Benjamin.  Not as you say it.

However, I often met needs that could have been resolved as you say in
some other languages, and that were easily addressed using more Pythonic
paradigms.  My belief if that Python is very flexible for such problems,
if you accept to "negotiate" with the language.

If you explain a bit more precisely what is the problem you are trying to
solve, it is likely that many members of the Python list will have ideas
or solutions to offer, that you might find workable and even elegant.
This is my guess, do not take it as a promise :-).

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard





More information about the Python-list mailing list