Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Peter Pearson Newsgroups: comp.lang.python Subject: Re: Not Responding When Dealing with Large Data Date: 19 Jun 2014 16:21:21 GMT Lines: 26 Message-ID: References: <00d330e3-fc8a-4b7e-b2bd-f1a48bc335c1@googlegroups.com> <1abc3e5d-8002-4ecc-b433-a862c4918e74@googlegroups.com> <69964062-b0a4-4153-a488-22202dea62bb@googlegroups.com> X-Trace: individual.net 8B2Bb/zeF8lQA7o6R43WggiN8noGxJHcc/FaghIFNpt8dLBaZQ Cancel-Lock: sha1:iZviOKO4Q2dW8HIcA7Db5gS3J2U= User-Agent: slrn/pre1.0.0-18 (Linux) Xref: csiph.com comp.lang.python:73437 On Thu, 19 Jun 2014 12:25:23 +0100, MRAB wrote: [snip] > and then you can say: > > def myCase(c): > if len(c) < 8 or len(c) > 80: > return False > > if c in mySet: > return False > > return True > > which can be shortened to: > > def myCase(c): > return 8 <= len(c) <= 80 and c in mySet Don't you mean . . . return 8 <= len(c) <= 80 and c not in mySet ? -- To email me, substitute nowhere->spamcop, invalid->net.