Show More
@@ -76,12 +76,12 b" fileline = '" | |||||
76 | filelogentry = filelogentry.tmpl |
|
76 | filelogentry = filelogentry.tmpl | |
77 |
|
77 | |||
78 | annotateline = ' |
|
78 | annotateline = ' | |
79 | <tr> |
|
79 | <tr id="{lineid}"> | |
80 | <td class="annotate"> |
|
80 | <td class="annotate"> | |
81 | <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}" |
|
81 | <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}" | |
82 | title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a> |
|
82 | title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a> | |
83 | </td> |
|
83 | </td> | |
84 |
<td class="source"><a href="#{lineid}" |
|
84 | <td class="source"><a href="#{lineid}">{linenumber}</a> {line|escape}</td> | |
85 | </tr>' |
|
85 | </tr>' | |
86 |
|
86 | |||
87 | diffblock = '<div class="bottomline inc-lineno"><pre class="sourcelines wrap">{lines}</pre></div>' |
|
87 | diffblock = '<div class="bottomline inc-lineno"><pre class="sourcelines wrap">{lines}</pre></div>' |
@@ -275,229 +275,229 b' hgweb fileannotate, html' | |||||
275 | </tr> |
|
275 | </tr> | |
276 | <tbody class="stripes2"> |
|
276 | <tbody class="stripes2"> | |
277 |
|
277 | |||
278 | <tr> |
|
278 | <tr id="l1"> | |
279 | <td class="annotate"> |
|
279 | <td class="annotate"> | |
280 | <a href="/annotate/853dcd4de2a6/primes.py#l1" |
|
280 | <a href="/annotate/853dcd4de2a6/primes.py#l1" | |
281 | title="853dcd4de2a6: a">test@0</a> |
|
281 | title="853dcd4de2a6: a">test@0</a> | |
282 | </td> |
|
282 | </td> | |
283 |
<td class="source"><a href="#l1 |
|
283 | <td class="source"><a href="#l1"> 1</a> <span class="c">#!/usr/bin/env python</span></td> | |
284 | </tr> |
|
284 | </tr> | |
285 | <tr> |
|
285 | <tr id="l2"> | |
286 | <td class="annotate"> |
|
286 | <td class="annotate"> | |
287 | <a href="/annotate/853dcd4de2a6/primes.py#l2" |
|
287 | <a href="/annotate/853dcd4de2a6/primes.py#l2" | |
288 | title="853dcd4de2a6: a">test@0</a> |
|
288 | title="853dcd4de2a6: a">test@0</a> | |
289 | </td> |
|
289 | </td> | |
290 |
<td class="source"><a href="#l2" |
|
290 | <td class="source"><a href="#l2"> 2</a> </td> | |
291 | </tr> |
|
291 | </tr> | |
292 | <tr> |
|
292 | <tr id="l3"> | |
293 | <td class="annotate"> |
|
293 | <td class="annotate"> | |
294 | <a href="/annotate/853dcd4de2a6/primes.py#l3" |
|
294 | <a href="/annotate/853dcd4de2a6/primes.py#l3" | |
295 | title="853dcd4de2a6: a">test@0</a> |
|
295 | title="853dcd4de2a6: a">test@0</a> | |
296 | </td> |
|
296 | </td> | |
297 |
<td class="source"><a href="#l3 |
|
297 | <td class="source"><a href="#l3"> 3</a> <span class="sd">"""Fun with generators. Corresponding Haskell implementation:</span></td> | |
298 | </tr> |
|
298 | </tr> | |
299 | <tr> |
|
299 | <tr id="l4"> | |
300 | <td class="annotate"> |
|
300 | <td class="annotate"> | |
301 | <a href="/annotate/853dcd4de2a6/primes.py#l4" |
|
301 | <a href="/annotate/853dcd4de2a6/primes.py#l4" | |
302 | title="853dcd4de2a6: a">test@0</a> |
|
302 | title="853dcd4de2a6: a">test@0</a> | |
303 | </td> |
|
303 | </td> | |
304 |
<td class="source"><a href="#l4" |
|
304 | <td class="source"><a href="#l4"> 4</a> </td> | |
305 | </tr> |
|
305 | </tr> | |
306 | <tr> |
|
306 | <tr id="l5"> | |
307 | <td class="annotate"> |
|
307 | <td class="annotate"> | |
308 | <a href="/annotate/853dcd4de2a6/primes.py#l5" |
|
308 | <a href="/annotate/853dcd4de2a6/primes.py#l5" | |
309 | title="853dcd4de2a6: a">test@0</a> |
|
309 | title="853dcd4de2a6: a">test@0</a> | |
310 | </td> |
|
310 | </td> | |
311 |
<td class="source"><a href="#l5 |
|
311 | <td class="source"><a href="#l5"> 5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td> | |
312 | </tr> |
|
312 | </tr> | |
313 | <tr> |
|
313 | <tr id="l6"> | |
314 | <td class="annotate"> |
|
314 | <td class="annotate"> | |
315 | <a href="/annotate/853dcd4de2a6/primes.py#l6" |
|
315 | <a href="/annotate/853dcd4de2a6/primes.py#l6" | |
316 | title="853dcd4de2a6: a">test@0</a> |
|
316 | title="853dcd4de2a6: a">test@0</a> | |
317 | </td> |
|
317 | </td> | |
318 |
<td class="source"><a href="#l6 |
|
318 | <td class="source"><a href="#l6"> 6</a> <span class="sd"> where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0]</span></td> | |
319 | </tr> |
|
319 | </tr> | |
320 | <tr> |
|
320 | <tr id="l7"> | |
321 | <td class="annotate"> |
|
321 | <td class="annotate"> | |
322 | <a href="/annotate/853dcd4de2a6/primes.py#l7" |
|
322 | <a href="/annotate/853dcd4de2a6/primes.py#l7" | |
323 | title="853dcd4de2a6: a">test@0</a> |
|
323 | title="853dcd4de2a6: a">test@0</a> | |
324 | </td> |
|
324 | </td> | |
325 |
<td class="source"><a href="#l7 |
|
325 | <td class="source"><a href="#l7"> 7</a> <span class="sd">"""</span></td> | |
326 | </tr> |
|
326 | </tr> | |
327 | <tr> |
|
327 | <tr id="l8"> | |
328 | <td class="annotate"> |
|
328 | <td class="annotate"> | |
329 | <a href="/annotate/853dcd4de2a6/primes.py#l8" |
|
329 | <a href="/annotate/853dcd4de2a6/primes.py#l8" | |
330 | title="853dcd4de2a6: a">test@0</a> |
|
330 | title="853dcd4de2a6: a">test@0</a> | |
331 | </td> |
|
331 | </td> | |
332 |
<td class="source"><a href="#l8" |
|
332 | <td class="source"><a href="#l8"> 8</a> </td> | |
333 | </tr> |
|
333 | </tr> | |
334 | <tr> |
|
334 | <tr id="l9"> | |
335 | <td class="annotate"> |
|
335 | <td class="annotate"> | |
336 | <a href="/annotate/853dcd4de2a6/primes.py#l9" |
|
336 | <a href="/annotate/853dcd4de2a6/primes.py#l9" | |
337 | title="853dcd4de2a6: a">test@0</a> |
|
337 | title="853dcd4de2a6: a">test@0</a> | |
338 | </td> |
|
338 | </td> | |
339 |
<td class="source"><a href="#l9" |
|
339 | <td class="source"><a href="#l9"> 9</a> <span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></td> | |
340 | </tr> |
|
340 | </tr> | |
341 | <tr> |
|
341 | <tr id="l10"> | |
342 | <td class="annotate"> |
|
342 | <td class="annotate"> | |
343 | <a href="/annotate/853dcd4de2a6/primes.py#l10" |
|
343 | <a href="/annotate/853dcd4de2a6/primes.py#l10" | |
344 | title="853dcd4de2a6: a">test@0</a> |
|
344 | title="853dcd4de2a6: a">test@0</a> | |
345 | </td> |
|
345 | </td> | |
346 |
<td class="source"><a href="#l10" |
|
346 | <td class="source"><a href="#l10"> 10</a> </td> | |
347 | </tr> |
|
347 | </tr> | |
348 | <tr> |
|
348 | <tr id="l11"> | |
349 | <td class="annotate"> |
|
349 | <td class="annotate"> | |
350 | <a href="/annotate/853dcd4de2a6/primes.py#l11" |
|
350 | <a href="/annotate/853dcd4de2a6/primes.py#l11" | |
351 | title="853dcd4de2a6: a">test@0</a> |
|
351 | title="853dcd4de2a6: a">test@0</a> | |
352 | </td> |
|
352 | </td> | |
353 |
<td class="source"><a href="#l11 |
|
353 | <td class="source"><a href="#l11"> 11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td> | |
354 | </tr> |
|
354 | </tr> | |
355 | <tr> |
|
355 | <tr id="l12"> | |
356 | <td class="annotate"> |
|
356 | <td class="annotate"> | |
357 | <a href="/annotate/853dcd4de2a6/primes.py#l12" |
|
357 | <a href="/annotate/853dcd4de2a6/primes.py#l12" | |
358 | title="853dcd4de2a6: a">test@0</a> |
|
358 | title="853dcd4de2a6: a">test@0</a> | |
359 | </td> |
|
359 | </td> | |
360 |
<td class="source"><a href="#l12 |
|
360 | <td class="source"><a href="#l12"> 12</a> <span class="sd">"""Generate all primes."""</span></td> | |
361 | </tr> |
|
361 | </tr> | |
362 | <tr> |
|
362 | <tr id="l13"> | |
363 | <td class="annotate"> |
|
363 | <td class="annotate"> | |
364 | <a href="/annotate/853dcd4de2a6/primes.py#l13" |
|
364 | <a href="/annotate/853dcd4de2a6/primes.py#l13" | |
365 | title="853dcd4de2a6: a">test@0</a> |
|
365 | title="853dcd4de2a6: a">test@0</a> | |
366 | </td> |
|
366 | </td> | |
367 |
<td class="source"><a href="#l13 |
|
367 | <td class="source"><a href="#l13"> 13</a> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td> | |
368 | </tr> |
|
368 | </tr> | |
369 | <tr> |
|
369 | <tr id="l14"> | |
370 | <td class="annotate"> |
|
370 | <td class="annotate"> | |
371 | <a href="/annotate/853dcd4de2a6/primes.py#l14" |
|
371 | <a href="/annotate/853dcd4de2a6/primes.py#l14" | |
372 | title="853dcd4de2a6: a">test@0</a> |
|
372 | title="853dcd4de2a6: a">test@0</a> | |
373 | </td> |
|
373 | </td> | |
374 |
<td class="source"><a href="#l14 |
|
374 | <td class="source"><a href="#l14"> 14</a> <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></td> | |
375 | </tr> |
|
375 | </tr> | |
376 | <tr> |
|
376 | <tr id="l15"> | |
377 | <td class="annotate"> |
|
377 | <td class="annotate"> | |
378 | <a href="/annotate/853dcd4de2a6/primes.py#l15" |
|
378 | <a href="/annotate/853dcd4de2a6/primes.py#l15" | |
379 | title="853dcd4de2a6: a">test@0</a> |
|
379 | title="853dcd4de2a6: a">test@0</a> | |
380 | </td> |
|
380 | </td> | |
381 |
<td class="source"><a href="#l15 |
|
381 | <td class="source"><a href="#l15"> 15</a> <span class="c"># It is important to yield *here* in order to stop the</span></td> | |
382 | </tr> |
|
382 | </tr> | |
383 | <tr> |
|
383 | <tr id="l16"> | |
384 | <td class="annotate"> |
|
384 | <td class="annotate"> | |
385 | <a href="/annotate/853dcd4de2a6/primes.py#l16" |
|
385 | <a href="/annotate/853dcd4de2a6/primes.py#l16" | |
386 | title="853dcd4de2a6: a">test@0</a> |
|
386 | title="853dcd4de2a6: a">test@0</a> | |
387 | </td> |
|
387 | </td> | |
388 |
<td class="source"><a href="#l16 |
|
388 | <td class="source"><a href="#l16"> 16</a> <span class="c"># infinite recursion.</span></td> | |
389 | </tr> |
|
389 | </tr> | |
390 | <tr> |
|
390 | <tr id="l17"> | |
391 | <td class="annotate"> |
|
391 | <td class="annotate"> | |
392 | <a href="/annotate/853dcd4de2a6/primes.py#l17" |
|
392 | <a href="/annotate/853dcd4de2a6/primes.py#l17" | |
393 | title="853dcd4de2a6: a">test@0</a> |
|
393 | title="853dcd4de2a6: a">test@0</a> | |
394 | </td> |
|
394 | </td> | |
395 |
<td class="source"><a href="#l17 |
|
395 | <td class="source"><a href="#l17"> 17</a> <span class="kn">yield</span> <span class="n">p</span></td> | |
396 | </tr> |
|
396 | </tr> | |
397 | <tr> |
|
397 | <tr id="l18"> | |
398 | <td class="annotate"> |
|
398 | <td class="annotate"> | |
399 | <a href="/annotate/853dcd4de2a6/primes.py#l18" |
|
399 | <a href="/annotate/853dcd4de2a6/primes.py#l18" | |
400 | title="853dcd4de2a6: a">test@0</a> |
|
400 | title="853dcd4de2a6: a">test@0</a> | |
401 | </td> |
|
401 | </td> | |
402 |
<td class="source"><a href="#l18" |
|
402 | <td class="source"><a href="#l18"> 18</a> <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mf">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></td> | |
403 | </tr> |
|
403 | </tr> | |
404 | <tr> |
|
404 | <tr id="l19"> | |
405 | <td class="annotate"> |
|
405 | <td class="annotate"> | |
406 | <a href="/annotate/853dcd4de2a6/primes.py#l19" |
|
406 | <a href="/annotate/853dcd4de2a6/primes.py#l19" | |
407 | title="853dcd4de2a6: a">test@0</a> |
|
407 | title="853dcd4de2a6: a">test@0</a> | |
408 | </td> |
|
408 | </td> | |
409 |
<td class="source"><a href="#l19 |
|
409 | <td class="source"><a href="#l19"> 19</a> <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td> | |
410 | </tr> |
|
410 | </tr> | |
411 | <tr> |
|
411 | <tr id="l20"> | |
412 | <td class="annotate"> |
|
412 | <td class="annotate"> | |
413 | <a href="/annotate/853dcd4de2a6/primes.py#l20" |
|
413 | <a href="/annotate/853dcd4de2a6/primes.py#l20" | |
414 | title="853dcd4de2a6: a">test@0</a> |
|
414 | title="853dcd4de2a6: a">test@0</a> | |
415 | </td> |
|
415 | </td> | |
416 |
<td class="source"><a href="#l20 |
|
416 | <td class="source"><a href="#l20"> 20</a> <span class="kn">yield</span> <span class="n">n</span></td> | |
417 | </tr> |
|
417 | </tr> | |
418 | <tr> |
|
418 | <tr id="l21"> | |
419 | <td class="annotate"> |
|
419 | <td class="annotate"> | |
420 | <a href="/annotate/853dcd4de2a6/primes.py#l21" |
|
420 | <a href="/annotate/853dcd4de2a6/primes.py#l21" | |
421 | title="853dcd4de2a6: a">test@0</a> |
|
421 | title="853dcd4de2a6: a">test@0</a> | |
422 | </td> |
|
422 | </td> | |
423 |
<td class="source"><a href="#l21" |
|
423 | <td class="source"><a href="#l21"> 21</a> </td> | |
424 | </tr> |
|
424 | </tr> | |
425 | <tr> |
|
425 | <tr id="l22"> | |
426 | <td class="annotate"> |
|
426 | <td class="annotate"> | |
427 | <a href="/annotate/853dcd4de2a6/primes.py#l22" |
|
427 | <a href="/annotate/853dcd4de2a6/primes.py#l22" | |
428 | title="853dcd4de2a6: a">test@0</a> |
|
428 | title="853dcd4de2a6: a">test@0</a> | |
429 | </td> |
|
429 | </td> | |
430 |
<td class="source"><a href="#l22 |
|
430 | <td class="source"><a href="#l22"> 22</a> <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mf">2</span> <span class="o">==</span> <span class="mf">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></td> | |
431 | </tr> |
|
431 | </tr> | |
432 | <tr> |
|
432 | <tr id="l23"> | |
433 | <td class="annotate"> |
|
433 | <td class="annotate"> | |
434 | <a href="/annotate/853dcd4de2a6/primes.py#l23" |
|
434 | <a href="/annotate/853dcd4de2a6/primes.py#l23" | |
435 | title="853dcd4de2a6: a">test@0</a> |
|
435 | title="853dcd4de2a6: a">test@0</a> | |
436 | </td> |
|
436 | </td> | |
437 |
<td class="source"><a href="#l23 |
|
437 | <td class="source"><a href="#l23"> 23</a> <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mf">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o"><</span> <span class="mf">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></td> | |
438 | </tr> |
|
438 | </tr> | |
439 | <tr> |
|
439 | <tr id="l24"> | |
440 | <td class="annotate"> |
|
440 | <td class="annotate"> | |
441 | <a href="/annotate/853dcd4de2a6/primes.py#l24" |
|
441 | <a href="/annotate/853dcd4de2a6/primes.py#l24" | |
442 | title="853dcd4de2a6: a">test@0</a> |
|
442 | title="853dcd4de2a6: a">test@0</a> | |
443 | </td> |
|
443 | </td> | |
444 |
<td class="source"><a href="#l24" |
|
444 | <td class="source"><a href="#l24"> 24</a> </td> | |
445 | </tr> |
|
445 | </tr> | |
446 | <tr> |
|
446 | <tr id="l25"> | |
447 | <td class="annotate"> |
|
447 | <td class="annotate"> | |
448 | <a href="/annotate/853dcd4de2a6/primes.py#l25" |
|
448 | <a href="/annotate/853dcd4de2a6/primes.py#l25" | |
449 | title="853dcd4de2a6: a">test@0</a> |
|
449 | title="853dcd4de2a6: a">test@0</a> | |
450 | </td> |
|
450 | </td> | |
451 |
<td class="source"><a href="#l25 |
|
451 | <td class="source"><a href="#l25"> 25</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">"__main__"</span><span class="p">:</span></td> | |
452 | </tr> |
|
452 | </tr> | |
453 | <tr> |
|
453 | <tr id="l26"> | |
454 | <td class="annotate"> |
|
454 | <td class="annotate"> | |
455 | <a href="/annotate/853dcd4de2a6/primes.py#l26" |
|
455 | <a href="/annotate/853dcd4de2a6/primes.py#l26" | |
456 | title="853dcd4de2a6: a">test@0</a> |
|
456 | title="853dcd4de2a6: a">test@0</a> | |
457 | </td> |
|
457 | </td> | |
458 |
<td class="source"><a href="#l26 |
|
458 | <td class="source"><a href="#l26"> 26</a> <span class="kn">import</span> <span class="nn">sys</span></td> | |
459 | </tr> |
|
459 | </tr> | |
460 | <tr> |
|
460 | <tr id="l27"> | |
461 | <td class="annotate"> |
|
461 | <td class="annotate"> | |
462 | <a href="/annotate/853dcd4de2a6/primes.py#l27" |
|
462 | <a href="/annotate/853dcd4de2a6/primes.py#l27" | |
463 | title="853dcd4de2a6: a">test@0</a> |
|
463 | title="853dcd4de2a6: a">test@0</a> | |
464 | </td> |
|
464 | </td> | |
465 |
<td class="source"><a href="#l27 |
|
465 | <td class="source"><a href="#l27"> 27</a> <span class="kn">try</span><span class="p">:</span></td> | |
466 | </tr> |
|
466 | </tr> | |
467 | <tr> |
|
467 | <tr id="l28"> | |
468 | <td class="annotate"> |
|
468 | <td class="annotate"> | |
469 | <a href="/annotate/853dcd4de2a6/primes.py#l28" |
|
469 | <a href="/annotate/853dcd4de2a6/primes.py#l28" | |
470 | title="853dcd4de2a6: a">test@0</a> |
|
470 | title="853dcd4de2a6: a">test@0</a> | |
471 | </td> |
|
471 | </td> | |
472 |
<td class="source"><a href="#l28 |
|
472 | <td class="source"><a href="#l28"> 28</a> <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mf">1</span><span class="p">])</span></td> | |
473 | </tr> |
|
473 | </tr> | |
474 | <tr> |
|
474 | <tr id="l29"> | |
475 | <td class="annotate"> |
|
475 | <td class="annotate"> | |
476 | <a href="/annotate/853dcd4de2a6/primes.py#l29" |
|
476 | <a href="/annotate/853dcd4de2a6/primes.py#l29" | |
477 | title="853dcd4de2a6: a">test@0</a> |
|
477 | title="853dcd4de2a6: a">test@0</a> | |
478 | </td> |
|
478 | </td> | |
479 |
<td class="source"><a href="#l29 |
|
479 | <td class="source"><a href="#l29"> 29</a> <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></td> | |
480 | </tr> |
|
480 | </tr> | |
481 | <tr> |
|
481 | <tr id="l30"> | |
482 | <td class="annotate"> |
|
482 | <td class="annotate"> | |
483 | <a href="/annotate/853dcd4de2a6/primes.py#l30" |
|
483 | <a href="/annotate/853dcd4de2a6/primes.py#l30" | |
484 | title="853dcd4de2a6: a">test@0</a> |
|
484 | title="853dcd4de2a6: a">test@0</a> | |
485 | </td> |
|
485 | </td> | |
486 |
<td class="source"><a href="#l30 |
|
486 | <td class="source"><a href="#l30"> 30</a> <span class="n">n</span> <span class="o">=</span> <span class="mf">10</span></td> | |
487 | </tr> |
|
487 | </tr> | |
488 | <tr> |
|
488 | <tr id="l31"> | |
489 | <td class="annotate"> |
|
489 | <td class="annotate"> | |
490 | <a href="/annotate/853dcd4de2a6/primes.py#l31" |
|
490 | <a href="/annotate/853dcd4de2a6/primes.py#l31" | |
491 | title="853dcd4de2a6: a">test@0</a> |
|
491 | title="853dcd4de2a6: a">test@0</a> | |
492 | </td> |
|
492 | </td> | |
493 |
<td class="source"><a href="#l31 |
|
493 | <td class="source"><a href="#l31"> 31</a> <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></td> | |
494 | </tr> |
|
494 | </tr> | |
495 | <tr> |
|
495 | <tr id="l32"> | |
496 | <td class="annotate"> |
|
496 | <td class="annotate"> | |
497 | <a href="/annotate/853dcd4de2a6/primes.py#l32" |
|
497 | <a href="/annotate/853dcd4de2a6/primes.py#l32" | |
498 | title="853dcd4de2a6: a">test@0</a> |
|
498 | title="853dcd4de2a6: a">test@0</a> | |
499 | </td> |
|
499 | </td> | |
500 |
<td class="source"><a href="#l32 |
|
500 | <td class="source"><a href="#l32"> 32</a> <span class="kn">print</span> <span class="s">"The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></td> | |
501 | </tr> |
|
501 | </tr> | |
502 | </tbody> |
|
502 | </tbody> | |
503 | </table> |
|
503 | </table> |
General Comments 0
You need to be logged in to leave comments.
Login now