Re: Poll on Eval in Python

2009-10-20 Thread Nobody
On Tue, 20 Oct 2009 11:08:00 -0700, TerryP wrote: > On Oct 20, 4:30 pm, Nobody wrote: >> One language's "eval" isn't the same as another's. E.g. there's a big >> difference between Lisp's "eval" (which takes an s-expression as an >> argument) and an "eval" which takes a string as an argument. >>

Re: Poll on Eval in Python

2009-10-20 Thread TerryP
On Oct 20, 4:30 pm, Nobody wrote: > One language's "eval" isn't the same as another's. E.g. there's a big > difference between Lisp's "eval" (which takes an s-expression as an > argument) and an "eval" which takes a string as an argument. > > The former is fine; the latter should be prohibited by

Re: Poll on Eval in Python

2009-10-20 Thread Nobody
On Wed, 14 Oct 2009 23:48:11 +0200, Kazimir Majorinc wrote: >> (note: exec in python is more in spirit of eval then C-style exec >> functions) > > I thought about that, but decided not to ask about it > in poll, because I wanted to compare opinions on eval > specifically, not on all similar featu

Re: Poll on Eval in Python

2009-10-14 Thread TerryP
On Oct 14, 9:48 pm, Kazimir Majorinc wrote: > Do you think > it would be better if I asked that? That result would > be significantly different? > Not really. The eval, exec, and compile builtins are more or less related and serve similar purposes, but don't seem to be highly used in Python. Ther

Re: Poll on Eval in Python

2009-10-14 Thread Kazimir Majorinc
On 14.10.2009 17:55, TerryP wrote: And what about exec? (note: exec in python is more in spirit of eval then C-style exec functions) I thought about that, but decided not to ask about it in poll, because I wanted to compare opinions on eval specifically, not on all similar features. Do you t

Re: Poll on Eval in Python

2009-10-14 Thread Kazimir Majorinc
THE RESULTS OF THE POLLS . Lisp Python Ruby Eval is evil, harmful or at least unnecessary 2 (4.9%) 7 (21.9%) 0 (0.0%) -- Eval is useful but ov

Re: Poll on Eval in Python

2009-10-12 Thread Kazimir Majorinc
On 10.10.2009 5:03, Kazimir Majorinc wrote: I am Lisp programmer and I write an article on issues as macros, fexprs and eval. I want to compare opinions of programmers of various programming languages on eval. If you want to contribute your opinion on eval in Python (or you want to look at

Poll on Eval in Python

2009-10-09 Thread Kazimir Majorinc
I am Lisp programmer and I write an article on issues as macros, fexprs and eval. I want to compare opinions of programmers of various programming languages on eval. If you want to contribute your opinion on eval in Python (or you want to look at result), the adress is: http

Re: eval() in python

2005-06-21 Thread Martin Blume
"Xah Lee" schrieb > > perhaps i'm tired, but why can't i run: > > t='m=3' > print eval(t) > Perhaps you didn't read the documentation? :-) Perhaps you didn't try hard enough? C:\WINNT>c:\programme\python\python Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32 Type "hel

Re: eval() in python

2005-06-21 Thread Benji York
harold fellermann wrote: > >>> s="print 'hello Xah Lee :-)'" > >>> exec(s) > hello Xah Lee :-) Note that because "exec" is a statement, the parentheses above are superfluous. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: eval() in python

2005-06-21 Thread Jeff Epler
On Tue, Jun 21, 2005 at 08:13:47AM -0400, Peter Hansen wrote: > Xah Lee wrote: > > the doc seems to suggest that eval is only for expressions... it says > > uses exec for statements, but i don't seem to see a exec function? > > Because it's a statement: http://docs.python.org/ref/exec.html#l2h-563

Re: eval() in python

2005-06-21 Thread Peter Hansen
Xah Lee wrote: > the doc seems to suggest that eval is only for expressions... it says > uses exec for statements, but i don't seem to see a exec function? Because it's a statement: http://docs.python.org/ref/exec.html#l2h-563 -- http://mail.python.org/mailman/listinfo/python-list

Re: eval() in python

2005-06-21 Thread harold fellermann
> the doc seems to suggest that eval is only for expressions... it says > uses exec for statements, but i don't seem to see a exec function? Python 2.4 (#1, Dec 30 2004, 08:00:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin Type "help", "copyright", "credits" or "license" for mo

eval() in python

2005-06-21 Thread Xah Lee
is it possible to eval a string like the following? m=''' i0=[0,1] i1=[2,3] i2=[4,'a'] h0=[] for j0 in i0: h1=[] for j1 in i1: h2=[] for j2 in i2: h2.append(f(j0,j1,j2)) h1.append( h2[:] ) h0.append( h1[:] ) return h0''' perhaps i'm tired, but why can't i run: t='m=3' pr