]> granicus.if.org Git - python/commitdiff
Expand comment.
authorRaymond Hettinger <python@rcn.com>
Tue, 8 Jan 2008 02:02:05 +0000 (02:02 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 8 Jan 2008 02:02:05 +0000 (02:02 +0000)
Lib/collections.py

index 099cdd62bdf6f5c4d1d96fba82f9db18b5dd98ad..a234b44902c088b29e615721735a2129963a26e6 100644 (file)
@@ -34,7 +34,8 @@ def namedtuple(typename, field_names, verbose=False):
 
     """
 
-    # Parse and validate the field names
+    # Parse and validate the field names.  Validation serves two purposes,
+    # generating informative error messages and preventing template injection attacks.
     if isinstance(field_names, basestring):
         field_names = field_names.replace(',', ' ').split() # names separated by whitespace and/or commas
     field_names = tuple(field_names)