Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 011670e

Browse files
author
Mark Pilgrim
committed
more sequence --> set bits
1 parent 91fa97d commit 011670e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

special-method-names.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,13 @@ <h2 id=acts-like-set>Classes That Act Like Sets</h2>
255255
<th>So You Write&hellip;
256256
<th>And Python Calls&hellip;
257257
<tr><th>
258-
<td>the length of a sequence
259-
<td><code class=pp><dfn>len</dfn>(seq)</code>
260-
<td><a href=http://www.python.org/doc/3.1/reference/datamodel.html#object.__len__><code>seq.<dfn>__len__</dfn>()</code></a>
258+
<td>the number of items
259+
<td><code class=pp><dfn>len</dfn>(s)</code>
260+
<td><a href=http://www.python.org/doc/3.1/reference/datamodel.html#object.__len__><code>s.<dfn>__len__</dfn>()</code></a>
261261
<tr><th>
262-
<td>to know whether a sequence contains a specific value
263-
<td><code class=pp>x in seq</code>
264-
<td><a href=http://www.python.org/doc/3.1/reference/datamodel.html#object.__contains__><code>seq.<dfn>__contains__</dfn>(<var>x</var>)</code></a>
262+
<td>to know whether it contains a specific value
263+
<td><code class=pp>x in s</code>
264+
<td><a href=http://www.python.org/doc/3.1/reference/datamodel.html#object.__contains__><code>s.<dfn>__contains__</dfn>(<var>x</var>)</code></a>
265265
</table>
266266

267267
<p id=acts-like-set-example>The <a href=http://docs.python.org/3.1/library/cgi.html><code>cgi</code> module</a> uses these methods in its <code>FieldStorage</code> class, which represents all of the form fields or query parameters submitted to a dynamic web page.

0 commit comments

Comments
 (0)