A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-October/038599.html below:

[Python-Dev] obj.__contains__() returns 1/0...

[Python-Dev] obj.__contains__() returns 1/0... [Python-Dev] obj.__contains__() returns 1/0...gminick gminick at hacker.pl
Wed Oct 8 15:42:18 EDT 2003
...shouldn't it return True/False?

examples:

>>> a = 'python'
>>> a.__contains__('perl')
0
>>> a.__contains__('python')
1
>>> a = { 'python' : 1, 'ruby' : 1 }
>>> a.__contains__('perl')
0
>>> a.__contains__('python')
1
>>>

instead of:

>>> a = 'python'
>>> a.__contains__('perl')
False
>>> a.__contains__('python')
True
>>> a = { 'python' : 1, 'ruby' : 1 }
>>> a.__contains__('perl')
False
>>> a.__contains__('python')
True
>>>


The reason for asking is that i.e. obj.__eq__() returns True/False,
and besides True/False looks nicer than 1/0 ;>

ps. I'll send a patch to sf.net in a matter of minutes.
    Please, decide if it should be applied, thanks.

-- 
[ Wojtek Walczak - gminick (at) underground.org.pl ]
[        <http://gminick.linuxsecurity.pl/>        ]
[ "...rozmaite zwroty, matowe od patyny dawnosci." ]


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4