Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.181 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.70; '*S*': 0.06; 'toggle': 0.09; 'def': 0.12; '"some': 0.16; 'dismiss': 0.16; 'travis': 0.16; 'wrote:': 0.18; 'header:In-Reply-To:1': 0.27; "i'm": 0.30; 'class': 0.32; 'received:google.com': 0.35; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'header:Message-Id:1': 0.63; 'charset:windows-1252': 0.65; 'between': 0.67; '2014,': 0.84; 'snake': 0.84; 'oil': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=Mk5ffOBq0nI0acE/TrmRCzEFWLOS5ADGG99jjo09nas=; b=aKIL3LznQmXrCfdWlp6MthmsGn9Ksww3fv/wDJO67b21x87K+ShewfS9lvaVIB9ag1 I/cjichm27+sFq7NDsD9/3mWzL1ETPfebMurA9wbCHScbryPdjIvTCT7IgCHU45/Po/D YcfKbIFpRwIfz//TMT2+c5IX/IeWG0mQPow1XGwzK2hcw51cWx97hsp7HMxBygDFhhwi sJSIKdqytIIofRUYqA2fY3PaDtosZR0Raa9opH1B9LxuzV3rvArg5x/HQ3BTw9NnCRyy ymF6iaJhwTYqRg+mRjgpLeI87AuYyDPbz4A40KvQFSb7FLQjABMudozfRGbCKUaeFFOJ pwkg== X-Received: by 10.50.114.40 with SMTP id jd8mr50715564igb.35.1412833112456; Wed, 08 Oct 2014 22:38:32 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Toggle From: Travis Griggs In-Reply-To: Date: Wed, 8 Oct 2014 22:38:26 -0700 Content-Transfer-Encoding: quoted-printable References: To: python-list@python.org X-Mailer: Apple Mail (2.1878.6) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412833121 news.xs4all.nl 2953 [2001:888:2000:d::a6]:56488 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3474 X-Received-Body-CRC: 358018219 Xref: csiph.com comp.lang.python:78875 On Oct 8, 2014, at 9:57 PM, Gregory Ewing = wrote: > Seymore4Head wrote: >> I want to toggle between color=3D"Red" and color=3D"Blue" Don=92t forget polymorphic dispatch=85 class Red(object): def toggle(self): return Blue() class Blue(object): def toggle(self): return Red() Blue().toggle().toggle().toggle().toggle().toggle() :) -- Travis Griggs Objologist "Some of them wanted to sell me snake oil and I'm not necessarily going = to dismiss all of these, as I have never found a rusty snake." --Terry = Pratchett