tests/test-highlight.out
changeset 9426 b42b03308ae9
parent 9424 799373ff2554
child 9720 bb00a159e594
equal deleted inserted replaced
9425:6cfea6e4c892 9426:b42b03308ae9
     1 adding isolatin.txt
       
     2 adding primes.py
     1 adding primes.py
     3 % hg serve
     2 % hg serve
     4 % hgweb filerevision, html
     3 % hgweb filerevision, html
     5 200 Script output follows
     4 200 Script output follows
     6 
     5 
    10 <link rel="icon" href="/static/hgicon.png" type="image/png" />
     9 <link rel="icon" href="/static/hgicon.png" type="image/png" />
    11 <meta name="robots" content="index, nofollow" />
    10 <meta name="robots" content="index, nofollow" />
    12 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
    11 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
    13 
    12 
    14 <link rel="stylesheet" href="/highlightcss" type="text/css" />
    13 <link rel="stylesheet" href="/highlightcss" type="text/css" />
    15 <title>test: 3e1445510fe7 primes.py</title>
    14 <title>test: 853dcd4de2a6 primes.py</title>
    16 </head>
    15 </head>
    17 <body>
    16 <body>
    18 
    17 
    19 <div class="container">
    18 <div class="container">
    20 <div class="menu">
    19 <div class="menu">
    21 <div class="logo">
    20 <div class="logo">
    22 <a href="http://mercurial.selenic.com/">
    21 <a href="http://mercurial.selenic.com/">
    23 <img src="/static/hglogo.png" alt="mercurial" /></a>
    22 <img src="/static/hglogo.png" alt="mercurial" /></a>
    24 </div>
    23 </div>
    25 <ul>
    24 <ul>
    26 <li><a href="/shortlog/3e1445510fe7">log</a></li>
    25 <li><a href="/shortlog/853dcd4de2a6">log</a></li>
    27 <li><a href="/graph/3e1445510fe7">graph</a></li>
    26 <li><a href="/graph/853dcd4de2a6">graph</a></li>
    28 <li><a href="/tags">tags</a></li>
    27 <li><a href="/tags">tags</a></li>
    29 <li><a href="/branches">branches</a></li>
    28 <li><a href="/branches">branches</a></li>
    30 </ul>
    29 </ul>
    31 <ul>
    30 <ul>
    32 <li><a href="/rev/3e1445510fe7">changeset</a></li>
    31 <li><a href="/rev/853dcd4de2a6">changeset</a></li>
    33 <li><a href="/file/3e1445510fe7/">browse</a></li>
    32 <li><a href="/file/853dcd4de2a6/">browse</a></li>
    34 </ul>
    33 </ul>
    35 <ul>
    34 <ul>
    36 <li class="active">file</li>
    35 <li class="active">file</li>
    37 <li><a href="/diff/3e1445510fe7/primes.py">diff</a></li>
    36 <li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
    38 <li><a href="/annotate/3e1445510fe7/primes.py">annotate</a></li>
    37 <li><a href="/annotate/853dcd4de2a6/primes.py">annotate</a></li>
    39 <li><a href="/log/3e1445510fe7/primes.py">file log</a></li>
    38 <li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
    40 <li><a href="/raw-file/3e1445510fe7/primes.py">raw</a></li>
    39 <li><a href="/raw-file/853dcd4de2a6/primes.py">raw</a></li>
    41 </ul>
    40 </ul>
    42 </div>
    41 </div>
    43 
    42 
    44 <div class="main">
    43 <div class="main">
    45 <h2><a href="/">test</a></h2>
    44 <h2><a href="/">test</a></h2>
    46 <h3>view primes.py @ 0:3e1445510fe7</h3>
    45 <h3>view primes.py @ 0:853dcd4de2a6</h3>
    47 
    46 
    48 <form class="search" action="/log">
    47 <form class="search" action="/log">
    49 
    48 
    50 <p><input name="rev" id="search1" type="text" size="30" /></p>
    49 <p><input name="rev" id="search1" type="text" size="30" /></p>
    51 <div id="hint">find changesets by author, revision,
    50 <div id="hint">find changesets by author, revision,
   117 
   116 
   118 
   117 
   119 </body>
   118 </body>
   120 </html>
   119 </html>
   121 
   120 
   122 % hgweb filerevision, html
   121 % hgweb fileannotate, html
   123 200 Script output follows
   122 200 Script output follows
   124 
   123 
   125 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
   124 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
   126 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
   125 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
   127 <head>
   126 <head>
   128 <link rel="icon" href="/static/hgicon.png" type="image/png" />
   127 <link rel="icon" href="/static/hgicon.png" type="image/png" />
   129 <meta name="robots" content="index, nofollow" />
   128 <meta name="robots" content="index, nofollow" />
   130 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
   129 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
   131 
   130 
   132 <link rel="stylesheet" href="/highlightcss" type="text/css" />
   131 <link rel="stylesheet" href="/highlightcss" type="text/css" />
   133 <title>test: 3e1445510fe7 isolatin.txt</title>
   132 <title>test: primes.py annotate</title>
   134 </head>
   133 </head>
   135 <body>
   134 <body>
   136 
   135 
   137 <div class="container">
   136 <div class="container">
   138 <div class="menu">
   137 <div class="menu">
   139 <div class="logo">
   138 <div class="logo">
   140 <a href="http://mercurial.selenic.com/">
   139 <a href="http://mercurial.selenic.com/">
   141 <img src="/static/hglogo.png" alt="mercurial" /></a>
   140 <img src="/static/hglogo.png" alt="mercurial" /></a>
   142 </div>
   141 </div>
   143 <ul>
   142 <ul>
   144 <li><a href="/shortlog/3e1445510fe7">log</a></li>
   143 <li><a href="/shortlog/853dcd4de2a6">log</a></li>
   145 <li><a href="/graph/3e1445510fe7">graph</a></li>
   144 <li><a href="/graph/853dcd4de2a6">graph</a></li>
   146 <li><a href="/tags">tags</a></li>
   145 <li><a href="/tags">tags</a></li>
   147 <li><a href="/branches">branches</a></li>
   146 <li><a href="/branches">branches</a></li>
   148 </ul>
   147 </ul>
   149 <ul>
   148 
   150 <li><a href="/rev/3e1445510fe7">changeset</a></li>
   149 <ul>
   151 <li><a href="/file/3e1445510fe7/">browse</a></li>
   150 <li><a href="/rev/853dcd4de2a6">changeset</a></li>
   152 </ul>
   151 <li><a href="/file/853dcd4de2a6/">browse</a></li>
   153 <ul>
   152 </ul>
   154 <li class="active">file</li>
   153 <ul>
   155 <li><a href="/diff/3e1445510fe7/isolatin.txt">diff</a></li>
   154 <li><a href="/file/853dcd4de2a6/primes.py">file</a></li>
   156 <li><a href="/annotate/3e1445510fe7/isolatin.txt">annotate</a></li>
   155 <li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
   157 <li><a href="/log/3e1445510fe7/isolatin.txt">file log</a></li>
   156 <li class="active">annotate</li>
   158 <li><a href="/raw-file/3e1445510fe7/isolatin.txt">raw</a></li>
   157 <li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
       
   158 <li><a href="/raw-annotate/853dcd4de2a6/primes.py">raw</a></li>
   159 </ul>
   159 </ul>
   160 </div>
   160 </div>
   161 
   161 
   162 <div class="main">
   162 <div class="main">
   163 <h2><a href="/">test</a></h2>
   163 <h2><a href="/">test</a></h2>
   164 <h3>view isolatin.txt @ 0:3e1445510fe7</h3>
   164 <h3>annotate primes.py @ 0:853dcd4de2a6</h3>
   165 
   165 
   166 <form class="search" action="/log">
   166 <form class="search" action="/log">
   167 
   167 
   168 <p><input name="rev" id="search1" type="text" size="30" /></p>
   168 <p><input name="rev" id="search1" type="text" size="30" /></p>
   169 <div id="hint">find changesets by author, revision,
   169 <div id="hint">find changesets by author, revision,
   191 </tr>
   191 </tr>
   192 
   192 
   193 </table>
   193 </table>
   194 
   194 
   195 <div class="overflow">
   195 <div class="overflow">
   196 <div class="sourcefirst"> line source</div>
       
   197 
       
   198 <div class="parity0 source"><a href="#l1" id="l1">     1</a> h?bsch</div>
       
   199 <div class="sourcelast"></div>
       
   200 </div>
       
   201 </div>
       
   202 </div>
       
   203 
       
   204 
       
   205 
       
   206 </body>
       
   207 </html>
       
   208 
       
   209 % hgweb fileannotate, html
       
   210 200 Script output follows
       
   211 
       
   212 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
       
   213 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
       
   214 <head>
       
   215 <link rel="icon" href="/static/hgicon.png" type="image/png" />
       
   216 <meta name="robots" content="index, nofollow" />
       
   217 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
       
   218 
       
   219 <link rel="stylesheet" href="/highlightcss" type="text/css" />
       
   220 <title>test: primes.py annotate</title>
       
   221 </head>
       
   222 <body>
       
   223 
       
   224 <div class="container">
       
   225 <div class="menu">
       
   226 <div class="logo">
       
   227 <a href="http://mercurial.selenic.com/">
       
   228 <img src="/static/hglogo.png" alt="mercurial" /></a>
       
   229 </div>
       
   230 <ul>
       
   231 <li><a href="/shortlog/3e1445510fe7">log</a></li>
       
   232 <li><a href="/graph/3e1445510fe7">graph</a></li>
       
   233 <li><a href="/tags">tags</a></li>
       
   234 <li><a href="/branches">branches</a></li>
       
   235 </ul>
       
   236 
       
   237 <ul>
       
   238 <li><a href="/rev/3e1445510fe7">changeset</a></li>
       
   239 <li><a href="/file/3e1445510fe7/">browse</a></li>
       
   240 </ul>
       
   241 <ul>
       
   242 <li><a href="/file/3e1445510fe7/primes.py">file</a></li>
       
   243 <li><a href="/diff/3e1445510fe7/primes.py">diff</a></li>
       
   244 <li class="active">annotate</li>
       
   245 <li><a href="/log/3e1445510fe7/primes.py">file log</a></li>
       
   246 <li><a href="/raw-annotate/3e1445510fe7/primes.py">raw</a></li>
       
   247 </ul>
       
   248 </div>
       
   249 
       
   250 <div class="main">
       
   251 <h2><a href="/">test</a></h2>
       
   252 <h3>annotate primes.py @ 0:3e1445510fe7</h3>
       
   253 
       
   254 <form class="search" action="/log">
       
   255 
       
   256 <p><input name="rev" id="search1" type="text" size="30" /></p>
       
   257 <div id="hint">find changesets by author, revision,
       
   258 files, or words in the commit message</div>
       
   259 </form>
       
   260 
       
   261 <div class="description">a</div>
       
   262 
       
   263 <table id="changesetEntry">
       
   264 <tr>
       
   265  <th class="author">author</th>
       
   266  <td class="author">&#116;&#101;&#115;&#116;</td>
       
   267 </tr>
       
   268 <tr>
       
   269  <th class="date">date</th>
       
   270  <td class="date">Thu Jan 01 00:00:00 1970 +0000 (many years ago)</td>
       
   271 </tr>
       
   272 <tr>
       
   273  <th class="author">parents</th>
       
   274  <td class="author"></td>
       
   275 </tr>
       
   276 <tr>
       
   277  <th class="author">children</th>
       
   278  <td class="author"></td>
       
   279 </tr>
       
   280 
       
   281 </table>
       
   282 
       
   283 <div class="overflow">
       
   284 <table class="bigtable">
   196 <table class="bigtable">
   285 <tr>
   197 <tr>
   286  <th class="annotate">rev</th>
   198  <th class="annotate">rev</th>
   287  <th class="line">&nbsp;&nbsp;line source</th>
   199  <th class="line">&nbsp;&nbsp;line source</th>
   288 </tr>
   200 </tr>
   289 
   201 
   290 <tr class="parity0">
   202 <tr class="parity0">
   291 <td class="annotate">
   203 <td class="annotate">
   292 <a href="/annotate/3e1445510fe7/primes.py#1"
   204 <a href="/annotate/853dcd4de2a6/primes.py#1"
   293 title="3e1445510fe7: a">test@0</a>
   205 title="853dcd4de2a6: a">test@0</a>
   294 </td>
   206 </td>
   295 <td class="source"><a href="#l1" id="l1">     1</a> <span class="c">#!/usr/bin/env python</span></td>
   207 <td class="source"><a href="#l1" id="l1">     1</a> <span class="c">#!/usr/bin/env python</span></td>
   296 </tr>
   208 </tr>
   297 <tr class="parity1">
   209 <tr class="parity1">
   298 <td class="annotate">
   210 <td class="annotate">
   299 <a href="/annotate/3e1445510fe7/primes.py#2"
   211 <a href="/annotate/853dcd4de2a6/primes.py#2"
   300 title="3e1445510fe7: a">test@0</a>
   212 title="853dcd4de2a6: a">test@0</a>
   301 </td>
   213 </td>
   302 <td class="source"><a href="#l2" id="l2">     2</a> </td>
   214 <td class="source"><a href="#l2" id="l2">     2</a> </td>
   303 </tr>
   215 </tr>
   304 <tr class="parity0">
   216 <tr class="parity0">
   305 <td class="annotate">
   217 <td class="annotate">
   306 <a href="/annotate/3e1445510fe7/primes.py#3"
   218 <a href="/annotate/853dcd4de2a6/primes.py#3"
   307 title="3e1445510fe7: a">test@0</a>
   219 title="853dcd4de2a6: a">test@0</a>
   308 </td>
   220 </td>
   309 <td class="source"><a href="#l3" id="l3">     3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></td>
   221 <td class="source"><a href="#l3" id="l3">     3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></td>
   310 </tr>
   222 </tr>
   311 <tr class="parity1">
   223 <tr class="parity1">
   312 <td class="annotate">
   224 <td class="annotate">
   313 <a href="/annotate/3e1445510fe7/primes.py#4"
   225 <a href="/annotate/853dcd4de2a6/primes.py#4"
   314 title="3e1445510fe7: a">test@0</a>
   226 title="853dcd4de2a6: a">test@0</a>
   315 </td>
   227 </td>
   316 <td class="source"><a href="#l4" id="l4">     4</a> </td>
   228 <td class="source"><a href="#l4" id="l4">     4</a> </td>
   317 </tr>
   229 </tr>
   318 <tr class="parity0">
   230 <tr class="parity0">
   319 <td class="annotate">
   231 <td class="annotate">
   320 <a href="/annotate/3e1445510fe7/primes.py#5"
   232 <a href="/annotate/853dcd4de2a6/primes.py#5"
   321 title="3e1445510fe7: a">test@0</a>
   233 title="853dcd4de2a6: a">test@0</a>
   322 </td>
   234 </td>
   323 <td class="source"><a href="#l5" id="l5">     5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td>
   235 <td class="source"><a href="#l5" id="l5">     5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td>
   324 </tr>
   236 </tr>
   325 <tr class="parity1">
   237 <tr class="parity1">
   326 <td class="annotate">
   238 <td class="annotate">
   327 <a href="/annotate/3e1445510fe7/primes.py#6"
   239 <a href="/annotate/853dcd4de2a6/primes.py#6"
   328 title="3e1445510fe7: a">test@0</a>
   240 title="853dcd4de2a6: a">test@0</a>
   329 </td>
   241 </td>
   330 <td class="source"><a href="#l6" id="l6">     6</a> <span class="sd">    where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></td>
   242 <td class="source"><a href="#l6" id="l6">     6</a> <span class="sd">    where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></td>
   331 </tr>
   243 </tr>
   332 <tr class="parity0">
   244 <tr class="parity0">
   333 <td class="annotate">
   245 <td class="annotate">
   334 <a href="/annotate/3e1445510fe7/primes.py#7"
   246 <a href="/annotate/853dcd4de2a6/primes.py#7"
   335 title="3e1445510fe7: a">test@0</a>
   247 title="853dcd4de2a6: a">test@0</a>
   336 </td>
   248 </td>
   337 <td class="source"><a href="#l7" id="l7">     7</a> <span class="sd">&quot;&quot;&quot;</span></td>
   249 <td class="source"><a href="#l7" id="l7">     7</a> <span class="sd">&quot;&quot;&quot;</span></td>
   338 </tr>
   250 </tr>
   339 <tr class="parity1">
   251 <tr class="parity1">
   340 <td class="annotate">
   252 <td class="annotate">
   341 <a href="/annotate/3e1445510fe7/primes.py#8"
   253 <a href="/annotate/853dcd4de2a6/primes.py#8"
   342 title="3e1445510fe7: a">test@0</a>
   254 title="853dcd4de2a6: a">test@0</a>
   343 </td>
   255 </td>
   344 <td class="source"><a href="#l8" id="l8">     8</a> </td>
   256 <td class="source"><a href="#l8" id="l8">     8</a> </td>
   345 </tr>
   257 </tr>
   346 <tr class="parity0">
   258 <tr class="parity0">
   347 <td class="annotate">
   259 <td class="annotate">
   348 <a href="/annotate/3e1445510fe7/primes.py#9"
   260 <a href="/annotate/853dcd4de2a6/primes.py#9"
   349 title="3e1445510fe7: a">test@0</a>
   261 title="853dcd4de2a6: a">test@0</a>
   350 </td>
   262 </td>
   351 <td class="source"><a href="#l9" id="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>
   263 <td class="source"><a href="#l9" id="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>
   352 </tr>
   264 </tr>
   353 <tr class="parity1">
   265 <tr class="parity1">
   354 <td class="annotate">
   266 <td class="annotate">
   355 <a href="/annotate/3e1445510fe7/primes.py#10"
   267 <a href="/annotate/853dcd4de2a6/primes.py#10"
   356 title="3e1445510fe7: a">test@0</a>
   268 title="853dcd4de2a6: a">test@0</a>
   357 </td>
   269 </td>
   358 <td class="source"><a href="#l10" id="l10">    10</a> </td>
   270 <td class="source"><a href="#l10" id="l10">    10</a> </td>
   359 </tr>
   271 </tr>
   360 <tr class="parity0">
   272 <tr class="parity0">
   361 <td class="annotate">
   273 <td class="annotate">
   362 <a href="/annotate/3e1445510fe7/primes.py#11"
   274 <a href="/annotate/853dcd4de2a6/primes.py#11"
   363 title="3e1445510fe7: a">test@0</a>
   275 title="853dcd4de2a6: a">test@0</a>
   364 </td>
   276 </td>
   365 <td class="source"><a href="#l11" id="l11">    11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
   277 <td class="source"><a href="#l11" id="l11">    11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
   366 </tr>
   278 </tr>
   367 <tr class="parity1">
   279 <tr class="parity1">
   368 <td class="annotate">
   280 <td class="annotate">
   369 <a href="/annotate/3e1445510fe7/primes.py#12"
   281 <a href="/annotate/853dcd4de2a6/primes.py#12"
   370 title="3e1445510fe7: a">test@0</a>
   282 title="853dcd4de2a6: a">test@0</a>
   371 </td>
   283 </td>
   372 <td class="source"><a href="#l12" id="l12">    12</a>     <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></td>
   284 <td class="source"><a href="#l12" id="l12">    12</a>     <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></td>
   373 </tr>
   285 </tr>
   374 <tr class="parity0">
   286 <tr class="parity0">
   375 <td class="annotate">
   287 <td class="annotate">
   376 <a href="/annotate/3e1445510fe7/primes.py#13"
   288 <a href="/annotate/853dcd4de2a6/primes.py#13"
   377 title="3e1445510fe7: a">test@0</a>
   289 title="853dcd4de2a6: a">test@0</a>
   378 </td>
   290 </td>
   379 <td class="source"><a href="#l13" id="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>
   291 <td class="source"><a href="#l13" id="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>
   380 </tr>
   292 </tr>
   381 <tr class="parity1">
   293 <tr class="parity1">
   382 <td class="annotate">
   294 <td class="annotate">
   383 <a href="/annotate/3e1445510fe7/primes.py#14"
   295 <a href="/annotate/853dcd4de2a6/primes.py#14"
   384 title="3e1445510fe7: a">test@0</a>
   296 title="853dcd4de2a6: a">test@0</a>
   385 </td>
   297 </td>
   386 <td class="source"><a href="#l14" id="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>
   298 <td class="source"><a href="#l14" id="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>
   387 </tr>
   299 </tr>
   388 <tr class="parity0">
   300 <tr class="parity0">
   389 <td class="annotate">
   301 <td class="annotate">
   390 <a href="/annotate/3e1445510fe7/primes.py#15"
   302 <a href="/annotate/853dcd4de2a6/primes.py#15"
   391 title="3e1445510fe7: a">test@0</a>
   303 title="853dcd4de2a6: a">test@0</a>
   392 </td>
   304 </td>
   393 <td class="source"><a href="#l15" id="l15">    15</a>         <span class="c"># It is important to yield *here* in order to stop the</span></td>
   305 <td class="source"><a href="#l15" id="l15">    15</a>         <span class="c"># It is important to yield *here* in order to stop the</span></td>
   394 </tr>
   306 </tr>
   395 <tr class="parity1">
   307 <tr class="parity1">
   396 <td class="annotate">
   308 <td class="annotate">
   397 <a href="/annotate/3e1445510fe7/primes.py#16"
   309 <a href="/annotate/853dcd4de2a6/primes.py#16"
   398 title="3e1445510fe7: a">test@0</a>
   310 title="853dcd4de2a6: a">test@0</a>
   399 </td>
   311 </td>
   400 <td class="source"><a href="#l16" id="l16">    16</a>         <span class="c"># infinite recursion.</span></td>
   312 <td class="source"><a href="#l16" id="l16">    16</a>         <span class="c"># infinite recursion.</span></td>
   401 </tr>
   313 </tr>
   402 <tr class="parity0">
   314 <tr class="parity0">
   403 <td class="annotate">
   315 <td class="annotate">
   404 <a href="/annotate/3e1445510fe7/primes.py#17"
   316 <a href="/annotate/853dcd4de2a6/primes.py#17"
   405 title="3e1445510fe7: a">test@0</a>
   317 title="853dcd4de2a6: a">test@0</a>
   406 </td>
   318 </td>
   407 <td class="source"><a href="#l17" id="l17">    17</a>         <span class="kn">yield</span> <span class="n">p</span></td>
   319 <td class="source"><a href="#l17" id="l17">    17</a>         <span class="kn">yield</span> <span class="n">p</span></td>
   408 </tr>
   320 </tr>
   409 <tr class="parity1">
   321 <tr class="parity1">
   410 <td class="annotate">
   322 <td class="annotate">
   411 <a href="/annotate/3e1445510fe7/primes.py#18"
   323 <a href="/annotate/853dcd4de2a6/primes.py#18"
   412 title="3e1445510fe7: a">test@0</a>
   324 title="853dcd4de2a6: a">test@0</a>
   413 </td>
   325 </td>
   414 <td class="source"><a href="#l18" id="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>
   326 <td class="source"><a href="#l18" id="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>
   415 </tr>
   327 </tr>
   416 <tr class="parity0">
   328 <tr class="parity0">
   417 <td class="annotate">
   329 <td class="annotate">
   418 <a href="/annotate/3e1445510fe7/primes.py#19"
   330 <a href="/annotate/853dcd4de2a6/primes.py#19"
   419 title="3e1445510fe7: a">test@0</a>
   331 title="853dcd4de2a6: a">test@0</a>
   420 </td>
   332 </td>
   421 <td class="source"><a href="#l19" id="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>
   333 <td class="source"><a href="#l19" id="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>
   422 </tr>
   334 </tr>
   423 <tr class="parity1">
   335 <tr class="parity1">
   424 <td class="annotate">
   336 <td class="annotate">
   425 <a href="/annotate/3e1445510fe7/primes.py#20"
   337 <a href="/annotate/853dcd4de2a6/primes.py#20"
   426 title="3e1445510fe7: a">test@0</a>
   338 title="853dcd4de2a6: a">test@0</a>
   427 </td>
   339 </td>
   428 <td class="source"><a href="#l20" id="l20">    20</a>             <span class="kn">yield</span> <span class="n">n</span></td>
   340 <td class="source"><a href="#l20" id="l20">    20</a>             <span class="kn">yield</span> <span class="n">n</span></td>
   429 </tr>
   341 </tr>
   430 <tr class="parity0">
   342 <tr class="parity0">
   431 <td class="annotate">
   343 <td class="annotate">
   432 <a href="/annotate/3e1445510fe7/primes.py#21"
   344 <a href="/annotate/853dcd4de2a6/primes.py#21"
   433 title="3e1445510fe7: a">test@0</a>
   345 title="853dcd4de2a6: a">test@0</a>
   434 </td>
   346 </td>
   435 <td class="source"><a href="#l21" id="l21">    21</a> </td>
   347 <td class="source"><a href="#l21" id="l21">    21</a> </td>
   436 </tr>
   348 </tr>
   437 <tr class="parity1">
   349 <tr class="parity1">
   438 <td class="annotate">
   350 <td class="annotate">
   439 <a href="/annotate/3e1445510fe7/primes.py#22"
   351 <a href="/annotate/853dcd4de2a6/primes.py#22"
   440 title="3e1445510fe7: a">test@0</a>
   352 title="853dcd4de2a6: a">test@0</a>
   441 </td>
   353 </td>
   442 <td class="source"><a href="#l22" id="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>
   354 <td class="source"><a href="#l22" id="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>
   443 </tr>
   355 </tr>
   444 <tr class="parity0">
   356 <tr class="parity0">
   445 <td class="annotate">
   357 <td class="annotate">
   446 <a href="/annotate/3e1445510fe7/primes.py#23"
   358 <a href="/annotate/853dcd4de2a6/primes.py#23"
   447 title="3e1445510fe7: a">test@0</a>
   359 title="853dcd4de2a6: a">test@0</a>
   448 </td>
   360 </td>
   449 <td class="source"><a href="#l23" id="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">&lt;</span> <span class="mf">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></td>
   361 <td class="source"><a href="#l23" id="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">&lt;</span> <span class="mf">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></td>
   450 </tr>
   362 </tr>
   451 <tr class="parity1">
   363 <tr class="parity1">
   452 <td class="annotate">
   364 <td class="annotate">
   453 <a href="/annotate/3e1445510fe7/primes.py#24"
   365 <a href="/annotate/853dcd4de2a6/primes.py#24"
   454 title="3e1445510fe7: a">test@0</a>
   366 title="853dcd4de2a6: a">test@0</a>
   455 </td>
   367 </td>
   456 <td class="source"><a href="#l24" id="l24">    24</a> </td>
   368 <td class="source"><a href="#l24" id="l24">    24</a> </td>
   457 </tr>
   369 </tr>
   458 <tr class="parity0">
   370 <tr class="parity0">
   459 <td class="annotate">
   371 <td class="annotate">
   460 <a href="/annotate/3e1445510fe7/primes.py#25"
   372 <a href="/annotate/853dcd4de2a6/primes.py#25"
   461 title="3e1445510fe7: a">test@0</a>
   373 title="853dcd4de2a6: a">test@0</a>
   462 </td>
   374 </td>
   463 <td class="source"><a href="#l25" id="l25">    25</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></td>
   375 <td class="source"><a href="#l25" id="l25">    25</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></td>
   464 </tr>
   376 </tr>
   465 <tr class="parity1">
   377 <tr class="parity1">
   466 <td class="annotate">
   378 <td class="annotate">
   467 <a href="/annotate/3e1445510fe7/primes.py#26"
   379 <a href="/annotate/853dcd4de2a6/primes.py#26"
   468 title="3e1445510fe7: a">test@0</a>
   380 title="853dcd4de2a6: a">test@0</a>
   469 </td>
   381 </td>
   470 <td class="source"><a href="#l26" id="l26">    26</a>     <span class="kn">import</span> <span class="nn">sys</span></td>
   382 <td class="source"><a href="#l26" id="l26">    26</a>     <span class="kn">import</span> <span class="nn">sys</span></td>
   471 </tr>
   383 </tr>
   472 <tr class="parity0">
   384 <tr class="parity0">
   473 <td class="annotate">
   385 <td class="annotate">
   474 <a href="/annotate/3e1445510fe7/primes.py#27"
   386 <a href="/annotate/853dcd4de2a6/primes.py#27"
   475 title="3e1445510fe7: a">test@0</a>
   387 title="853dcd4de2a6: a">test@0</a>
   476 </td>
   388 </td>
   477 <td class="source"><a href="#l27" id="l27">    27</a>     <span class="kn">try</span><span class="p">:</span></td>
   389 <td class="source"><a href="#l27" id="l27">    27</a>     <span class="kn">try</span><span class="p">:</span></td>
   478 </tr>
   390 </tr>
   479 <tr class="parity1">
   391 <tr class="parity1">
   480 <td class="annotate">
   392 <td class="annotate">
   481 <a href="/annotate/3e1445510fe7/primes.py#28"
   393 <a href="/annotate/853dcd4de2a6/primes.py#28"
   482 title="3e1445510fe7: a">test@0</a>
   394 title="853dcd4de2a6: a">test@0</a>
   483 </td>
   395 </td>
   484 <td class="source"><a href="#l28" id="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>
   396 <td class="source"><a href="#l28" id="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>
   485 </tr>
   397 </tr>
   486 <tr class="parity0">
   398 <tr class="parity0">
   487 <td class="annotate">
   399 <td class="annotate">
   488 <a href="/annotate/3e1445510fe7/primes.py#29"
   400 <a href="/annotate/853dcd4de2a6/primes.py#29"
   489 title="3e1445510fe7: a">test@0</a>
   401 title="853dcd4de2a6: a">test@0</a>
   490 </td>
   402 </td>
   491 <td class="source"><a href="#l29" id="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>
   403 <td class="source"><a href="#l29" id="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>
   492 </tr>
   404 </tr>
   493 <tr class="parity1">
   405 <tr class="parity1">
   494 <td class="annotate">
   406 <td class="annotate">
   495 <a href="/annotate/3e1445510fe7/primes.py#30"
   407 <a href="/annotate/853dcd4de2a6/primes.py#30"
   496 title="3e1445510fe7: a">test@0</a>
   408 title="853dcd4de2a6: a">test@0</a>
   497 </td>
   409 </td>
   498 <td class="source"><a href="#l30" id="l30">    30</a>         <span class="n">n</span> <span class="o">=</span> <span class="mf">10</span></td>
   410 <td class="source"><a href="#l30" id="l30">    30</a>         <span class="n">n</span> <span class="o">=</span> <span class="mf">10</span></td>
   499 </tr>
   411 </tr>
   500 <tr class="parity0">
   412 <tr class="parity0">
   501 <td class="annotate">
   413 <td class="annotate">
   502 <a href="/annotate/3e1445510fe7/primes.py#31"
   414 <a href="/annotate/853dcd4de2a6/primes.py#31"
   503 title="3e1445510fe7: a">test@0</a>
   415 title="853dcd4de2a6: a">test@0</a>
   504 </td>
   416 </td>
   505 <td class="source"><a href="#l31" id="l31">    31</a>     <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></td>
   417 <td class="source"><a href="#l31" id="l31">    31</a>     <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></td>
   506 </tr>
   418 </tr>
   507 <tr class="parity1">
   419 <tr class="parity1">
   508 <td class="annotate">
   420 <td class="annotate">
   509 <a href="/annotate/3e1445510fe7/primes.py#32"
   421 <a href="/annotate/853dcd4de2a6/primes.py#32"
   510 title="3e1445510fe7: a">test@0</a>
   422 title="853dcd4de2a6: a">test@0</a>
   511 </td>
   423 </td>
   512 <td class="source"><a href="#l32" id="l32">    32</a>     <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</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>
   424 <td class="source"><a href="#l32" id="l32">    32</a>     <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</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>
   513 </tr>
   425 </tr>
   514 </table>
   426 </table>
   515 </div>
   427 </div>