Re: numeric expression from string?

2006-02-06 Thread Brian Blais
Steven D'Aprano wrote: It is good to be cautious. Big thumbs up. But what exactly are you worried about? Do you think your users might enter something Evil and break their own system? I'd suggest that's not your problem, and besides, it is hard to think of anything they could do with eval

Re: numeric expression from string?

2006-02-06 Thread Alex Martelli
Brian Blais [EMAIL PROTECTED] wrote: someone might accidentally do damage to their system with an unchecked eval. Nah, it takes malice and deliberation to damage a system from an eval. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: numeric expression from string?

2006-02-06 Thread Blair P. Houghton
Steven wrote: Do you think your users might enter something Evil and break their own system? That's not usually how it works. How it usually works is: 1. Innocent code-monkey writes nifty applet, posts on usenet. 2. Innocent but dull-witted framework manufacturer includes nifty applet in Next

Re: numeric expression from string?

2006-02-06 Thread Blair P. Houghton
Steven wrote: Do you think your users might enter something Evil and break their own system? That's not usually how it works. How it usually works is: 1. Innocent code-monkey writes nifty applet, posts on usenet. 2. Innocent but dull-witted framework manufacturer includes nifty applet in Next

numeric expression from string?

2006-02-04 Thread Brian Blais
Hello, I have a string input from the user, and want to parse it to a number, and would like to know how to do it. I would like to be able to accept arithmetic operations, like: '5+5' '(4+3)*2' '5e3/10**3' I thought of using eval, which will work, but could lead to bad security problems

Re: numeric expression from string?

2006-02-04 Thread Diez B. Roggisch
Brian Blais schrieb: Hello, I have a string input from the user, and want to parse it to a number, and would like to know how to do it. I would like to be able to accept arithmetic operations, like: '5+5' '(4+3)*2' '5e3/10**3' I thought of using eval, which will work, but could

Re: numeric expression from string?

2006-02-04 Thread Steven D'Aprano
On Sat, 04 Feb 2006 06:48:11 -0500, Brian Blais wrote: Hello, I have a string input from the user, and want to parse it to a number, and would like to know how to do it. I would like to be able to accept arithmetic operations, like: '5+5' '(4+3)*2' '5e3/10**3' I thought of

Re: numeric expression from string?

2006-02-04 Thread Claudio Grondi
Brian Blais wrote: Hello, I have a string input from the user, and want to parse it to a number, and would like to know how to do it. I would like to be able to accept arithmetic operations, like: '5+5' '(4+3)*2' '5e3/10**3' I thought of using eval, which will work, but could lead

Re: numeric expression from string?

2006-02-04 Thread Tim Chase
I have a string input from the user, and want to parse it to a number, and would like to know how to do it. I would like to be able to accept arithmetic operations, like: '5+5' '(4+3)*2' '5e3/10**3' I thought of using eval, which will work, but could lead to bad security problems

Re: numeric expression from string?

2006-02-04 Thread Giovanni Bajo
Brian Blais wrote: I have a string input from the user, and want to parse it to a number, and would like to know how to do it. I would like to be able to accept arithmetic operations, like: '5+5' '(4+3)*2' '5e3/10**3' I thought of using eval, which will work, but could lead to bad