Skip to content

Commit

Permalink
Clarify HACKING's shadow built-in guidance.
Browse files Browse the repository at this point in the history
Change-Id: Icf38d3ec3254e83d2289b7b17966ec44d9757b8c
  • Loading branch information
rconradharris committed Mar 21, 2012
1 parent 521108d commit 66e152f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion HACKING.rst
Expand Up @@ -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
Expand Down

0 comments on commit 66e152f

Please sign in to comment.