]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- call it deque, since you can really pop from either side
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 10 Sep 2015 14:28:42 +0000 (10:28 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 10 Sep 2015 14:29:15 +0000 (10:29 -0400)
doc/build/faq/sessions.rst

index a89b3765c7e94e22c1347effa0497875e4e48b51..2e4bdd4c8fc0d7a24a86450f34d45620641039c6 100644 (file)
@@ -430,12 +430,12 @@ iterate all the objects, correcting for cycles as well::
 
 
     def walk(obj):
-        stack = [obj]
+        deque = [obj]
 
         seen = set()
 
-        while stack:
-            obj = stack.pop(0)
+        while deque:
+            obj = deque.pop(0)
             if obj in seen:
                 continue
             else:
@@ -445,9 +445,9 @@ iterate all the objects, correcting for cycles as well::
             for relationship in insp.mapper.relationships:
                 related = getattr(obj, relationship.key)
                 if relationship.uselist:
-                    stack.extend(related)
+                    deque.extend(related)
                 elif related is not None:
-                    stack.append(related)
+                    deque.append(related)
 
 The function can be demonstrated as follows::