Not Responding When Dealing with Large Data

Peter Pearson ppearson at nowhere.invalid
Thu Jun 19 12:21:21 EDT 2014


On Thu, 19 Jun 2014 12:25:23 +0100, MRAB <python at mrabarnett.plus.com> 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.



More information about the Python-list mailing list