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/2002-October/029132.html below:

[Python-Dev] the not operator (and the __not__ special method)

[Python-Dev] the not operator (and the __not__ special method) [Python-Dev] the not operator (and the __not__ special method)Aahz aahz@pythoncraft.com
Thu, 3 Oct 2002 19:22:15 -0400
On Thu, Oct 03, 2002, Brian Quinlan wrote:
>
> > shows that python doesn't call the __not__ special method
> > in a 'not' operator statement.
> 
> Python calls the special __nonzero__ method so check the truth value of
> an object.

Mark McEahern provided the full answer: Python uses __len__, too.
-- 
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/

Project Vote Smart: http://www.vote-smart.org/



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