Commits

Luke Plant committed 3bf558c

Replaced 'lambda:[]' with, simply, 'list'

Comments (0)

Files changed (3)

lukeplant_me_uk/bibleverses/build.py

 
 
 SchemeItem = struct("SchemeItem", (), 
-                    dict(verse=None, entries=lambda:[]))
+                    dict(verse=None, entries=list))
 """Represents an item in a scheme, which is a verse with the 
 TopicEntries that are relevant for this scheme."""
 

lukeplant_me_uk/bibleverses/parse.py

     return verses
 
 TopicNodeStruct = struct('TopicNodeStruct', (),
-                         dict(name=u"", nodes=lambda:[], entries=lambda:[], parent=None))
+                         dict(name=u"", nodes=list, entries=list, parent=None))
 
 class TopicNode(TopicNodeStruct):
 

lukeplant_me_uk/utils/datastructures.py

 
     >>> GenderedObject = struct("GenderedObject", (), dict(sex=None))
 
-    If the default attribute is mutable, use a callable (e.g. lambda)
-    to provide it, otherwise it will be shared between instances.  Use
-    the bases argument to inherit attribute definitions from other
-    structs.
+    If the default attribute is mutable, use a callable (e.g. a
+    lambda, a class or a factory function) to provide it, otherwise it
+    will be shared between instances.  Use the bases argument to
+    inherit attribute definitions from other structs.
 
-    >>> Parent = struct("Parent", (Person, GenderedObject), dict(children=lambda:[]))
+    >>> Parent = struct("Parent", (Person, GenderedObject), dict(children=list))
     >>> Parent(name="Fred", sex="male")
     <Parent age=0 children=[] name='Fred' sex='male'>
     """