is this a bug?

Just just at xs4all.nl
Sun Jul 7 17:23:15 EDT 2002


In article <1026076470.877638 at master.nyc.kbcfp.com>,
 "news" <burkhard.kloss at kbcfp.com> wrote:

> Python 2.0 (#1, Feb  7 2001, 22:41:16)
> [GCC 2.95.2 19991024 (release)] on sunos5
> Type "copyright", "credits" or "license" for more information.
> >>> "aa" in ["aa", "ab"]
> 1
> >>> "aa" in ["aa"]
> 1
> >>> "aa" in ("aa")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: 'in <string>' requires character as left operand
> 
> Is this a bug, or should this be consistent between lists and tuples?
> 
> Puzzled.

("aa") is not a tuple but a string:

  >>> ("aa")
  'aa'
  >>> ("aa",)
  ('aa',)
  >>> 

Just



More information about the Python-list mailing list