From 011670ef53e135a6413bd845d9ebb4dabb5721c0 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Tue, 27 Jul 2010 23:56:33 -0400 Subject: [PATCH] more sequence --> set bits --- special-method-names.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/special-method-names.html b/special-method-names.html index 0821d09..94bdd89 100644 --- a/special-method-names.html +++ b/special-method-names.html @@ -255,13 +255,13 @@ bytes = zef_file.read(12) So You Write… And Python Calls… -the length of a sequence -len(seq) -seq.__len__() +the number of items +len(s) +s.__len__() -to know whether a sequence contains a specific value -x in seq -seq.__contains__(x) +to know whether it contains a specific value +x in s +s.__contains__(x)

The cgi module uses these methods in its FieldStorage class, which represents all of the form fields or query parameters submitted to a dynamic web page.