Re: [BangPypers] Evaluating a string against mapping in python.

2014-10-26 Thread Noufal Ibrahim KV
On Sun, Oct 26 2014, Okan bhan wrote: [...] A simple implementation of this is: class SimpleMapping: def __init__(self, items): self._items = items def __getitems__(self, subitem): print('*' * 20) for item in self._items: if subitem in item: return True

[BangPypers] Evaluating a string against mapping in python.

2014-10-25 Thread Okan bhan
Hello everyone, Hope you all celebrated festival of Diwali with your loved ones. Wishes from my side to each one of you. I'm facing issue in understanding python's 'eval' function's behaviour. I've no previous deep knowledge of using 'eval' except that it is used to evaluate a string just like