Re: Characters contain themselves?

2006-04-10 Thread WENDUM Denis 47.76.11 (agent)
gry@ll.mit.edu wrote: > In fact, not just characters, but strings contain themselves: > > 'abc' in 'abc' > > True > > This is a very nice(i.e. clear and concise) shortcut for: > > 'the rain in spain stays mainly'.find('rain') != -1 > > True > > Which I always found contorted and a

Characters contain themselves?

2006-04-07 Thread WENDUM Denis 47.76.11 (agent)
While testing recursive algoritms dealing with generic lists I stumbled on infinite loops which were triggered by the fact that (at least for my version of Pyton) characters contain themselves.See session: system prompt% python Python 2.3.5 (#2, Feb 9 2005, 00:38:15) [GCC 3.3.5 (Debian 1:3.3.5