From 83078341301101f516e10c7fc0dbc56102b0150a Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Fri, 11 Sep 2009 16:06:39 -0400 Subject: [PATCH] removed inaccurate comparison to C --- native-datatypes.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native-datatypes.html b/native-datatypes.html index 4d67319..1c27fe9 100755 --- a/native-datatypes.html +++ b/native-datatypes.html @@ -544,7 +544,7 @@ AttributeError: 'tuple' object has no attribute 'remove'
  • v is a tuple of three elements, and (x, y, z) is a tuple of three variables. Assigning one to the other assigns each of the values of v to each of the variables, in order. -

    This has all kinds of uses. I often want to assign names to a range of values. In C, you would use enum and manually list each constant and its associated value, which seems especially tedious when the values are consecutive. In Python, you can use the built-in range() function with multi-variable assignment to quickly assign consecutive values. +

    This has all kinds of uses. Suppose you want to assign names to a range of values. You can use the built-in range() function with multi-variable assignment to quickly assign consecutive values.

     >>> (MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY) = range(7)