Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #65257
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <andrea.crotti.0@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.015 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'elements.': 0.07; 'try:': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; 'count,': 0.16; 'itertools': 0.16; 'lambda': 0.16; 'subject:generator': 0.16; 'true:': 0.16; 'import': 0.22; 'cc:addr:python.org': 0.22; 'fine': 0.24; 'cc:2**0': 0.24; 'header :In-Reply-To:1': 0.27; 'correct': 0.29; 'message- id:@mail.gmail.com': 0.30; 'except': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'yield': 0.36; 'thanks': 0.36; 'should': 0.36; 'clear': 0.37; 'thank': 0.38; 'filter': 0.38; 'changed': 0.39; 'number,': 0.60; 'break': 0.61; 'more': 0.64; 'to:addr:gmail.com': 0.65 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=9PLjl/GFqAs7KuNl/EZVXGAGcmrhr6FSv/fvJZqusSU=; b=MpFRmZB6Pr9fXSORXcWf7AR7GUZCy6GwK9wof09NYK9ShAlTAE1Vpr02IFGIXbQe49 tMKcXT0m0054aBFgUIUI5j+nBbHOyFZgJ173rP0O8dYbtEcw0eEOu36z4koqKiAeUE96 Gp7FVmmS0Af94sk/KUyZjA0NveyP5mRW4PCx0u9DDnyIK/s1lHBoYUsYP49OTuupzPEp FsaNPZmagj13+1dxgauoKrp5KDpRk8k83rLWpY2zgAgT3MoBJV0+Lt3qfrRBct8vsD8Z zCNux7Bgdgl+82iz/+EUQ0zPjiHqf+FNlS4rNfmSAWsZmGeBj56usuuhcvxsLK0iYuJ9 zLkg== |
| MIME-Version | 1.0 |
| X-Received | by 10.58.119.161 with SMTP id kv1mr562432veb.21.1391338120803; Sun, 02 Feb 2014 02:48:40 -0800 (PST) |
| In-Reply-To | <8118b17c-3352-4832-8567-089bd14c21ce@googlegroups.com> |
| References | <mailman.6278.1391263956.18130.python-list@python.org> <8118b17c-3352-4832-8567-089bd14c21ce@googlegroups.com> |
| Date | Sun, 2 Feb 2014 10:48:40 +0000 |
| Subject | Re: generator slides review |
| From | andrea crotti <andrea.crotti.0@gmail.com> |
| To | Miki Tebeka <miki.tebeka@gmail.com> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Cc | python-list <python-list@python.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.6302.1391338128.18130.python-list@python.org> (permalink) |
| Lines | 41 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1391338128 news.xs4all.nl 2934 [2001:888:2000:d::a6]:55483 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:65257 |
Show key headers only | View raw
2014-02-01 Miki Tebeka <miki.tebeka@gmail.com>: > > My 2 cents: > > slide 4: > [i*2 for i in range(10)] > Well this is not correct in theory because the end should be the max number, not the number of elements. So it should be [i*2 for i in range(10/2)] which might be fine but it's not really more clear imho.. > slide 9: > while True: > try: > it = next(g) > body(it) > except StopIteration: > break > Changed it thanks > slide 21: > from itertools import count, ifilterfalse > > def divided_by(p): > return lambda n: n % p == 0 > > def primes(): > nums = count(2) > while True: > p = next(nums) > yield p > nums = ifilterfalse(divided_by(p), nums) > Thank you that's nicer, but ifiilterfalse is not in Python 3 (could use filter of course).
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
generator slides review andrea crotti <andrea.crotti.0@gmail.com> - 2014-02-01 14:12 +0000
Re: generator slides review Miki Tebeka <miki.tebeka@gmail.com> - 2014-02-01 08:50 -0800
Re: generator slides review andrea crotti <andrea.crotti.0@gmail.com> - 2014-02-02 10:48 +0000
Re: generator slides review Miki Tebeka <miki.tebeka@gmail.com> - 2014-02-02 06:59 -0800
Re: generator slides review andrea crotti <andrea.crotti.0@gmail.com> - 2014-02-02 22:55 +0000
Re: generator slides review andrea crotti <andrea.crotti.0@gmail.com> - 2014-02-02 10:50 +0000
Re: generator slides review andrea crotti <andrea.crotti.0@gmail.com> - 2014-02-02 10:52 +0000
Re: generator slides review Peter Otten <__peter__@web.de> - 2014-02-02 13:47 +0100
csiph-web