[PATCH 04 of 15 yams V3] [misc] rename variable to avoid shadowing builtin

Laurent Peuch cortex at worlddomination.be
Wed Jan 15 20:59:04 CET 2020


# HG changeset patch
# User Laurent Peuch <cortex at worlddomination.be>
# Date 1578581008 -3600
#      Thu Jan 09 15:43:28 2020 +0100
# Node ID 067e8884dad968a90b5d7ddf3125ecfcd5e441a7
# Parent  c506694c7d4ee2202bf76bbe816b809f2303f88f
# Available At https://hg.logilab.org/users/lpeuch/yams
#              hg pull https://hg.logilab.org/users/lpeuch/yams -r 067e8884dad9
[misc] rename variable to avoid shadowing builtin

diff --git a/yams/buildobjs.py b/yams/buildobjs.py
--- a/yams/buildobjs.py
+++ b/yams/buildobjs.py
@@ -268,11 +268,11 @@ class AbstractTypedAttribute(SubjectRela
             meta = sorted(metadata.values(), key=lambda x: x.creation_rank)
             if meta[0].creation_rank < self.creation_rank:
                 previous = self
-                for next in meta:
-                    if previous.creation_rank < next.creation_rank:
+                for _next in meta:
+                    if previous.creation_rank < _next.creation_rank:
                         break
-                    previous.creation_rank, next.creation_rank = next.creation_rank, previous.creation_rank
-                    next = previous
+                    previous.creation_rank, _next.creation_rank = _next.creation_rank, previous.creation_rank
+                    _next = previous
 
     def set_vocabulary(self, vocabulary, kwargs=None):
         if kwargs is None:



More information about the cubicweb-devel mailing list