Mapping operator tokens to special methods

jamesthiele.usenet at gmail.com jamesthiele.usenet at gmail.com
Thu Feb 24 13:57:58 EST 2005


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 I want?




More information about the Python-list mailing list