Clarify HACKING's shadow built-in guidance.

Change-Id: Icf38d3ec3254e83d2289b7b17966ec44d9757b8c
This commit is contained in:
Rick Harris
2012-03-21 21:18:43 +00:00
parent 1cde21b576
commit 81e45630be

View File

@@ -12,7 +12,18 @@ General
- Put one newline between methods in classes and anywhere else
- Do not write "except:", use "except Exception:" at the very least
- Include your name with TODOs as in "#TODO(termie)"
- Do not name anything the same name as a built-in or reserved word
- Do not shadow a built-in or reserved word. Example::
def list():
return [1, 2, 3]
mylist = list() # BAD, shadows `list` built-in
class Foo(object):
def list(self):
return [1, 2, 3]
mylist = Foo().list() # OKAY, does not shadow built-in
Imports