Re: Mapping operator tokens to special methods

2005-02-24 Thread jamesthiele . usenet
John Machin wrote: >>> eval('1+2') 3 -- Yeah, that's what I decided to do. -- http://mail.python.org/mailman/listinfo/python-list

Re: Mapping operator tokens to special methods

2005-02-24 Thread John Machin
On 24 Feb 2005 10:57:58 -0800, [EMAIL PROTECTED] wrote: >I was starting to write a dictionary to map operator strings to their >equivalent special methods such as: >{ > '+' : 'add', > '&' : 'and_' >} > >The idea is to build a simple interactive calculator. > >and was wondering if there is alread

Re: Mapping operator tokens to special methods

2005-02-24 Thread Steven Bethard
[EMAIL PROTECTED] wrote: I was starting to write a dictionary to map operator strings to their equivalent special methods such as: { '+' : 'add', '&' : 'and_' } The idea is to build a simple interactive calculator. and was wondering if there is already something like this builtin? Or is there a

Mapping operator tokens to special methods

2005-02-24 Thread jamesthiele . usenet
I was starting to write a dictionary to map operator strings to their equivalent special methods such as: { '+' : 'add', '&' : 'and_' } The idea is to build a simple interactive calculator. and was wondering if there is already something like this builtin? Or is there a better way to do what