[PATCH 05 of 15 yams V3] [misc] rename previous to _previous to be consistant with _next

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


# HG changeset patch
# User Laurent Peuch <cortex at worlddomination.be>
# Date 1579100652 -3600
#      Wed Jan 15 16:04:12 2020 +0100
# Node ID f6c4e858f937ffa193d8161e2f559d52f3baf9f8
# Parent  067e8884dad968a90b5d7ddf3125ecfcd5e441a7
# Available At https://hg.logilab.org/users/lpeuch/yams
#              hg pull https://hg.logilab.org/users/lpeuch/yams -r f6c4e858f937
[misc] rename previous to _previous to be consistant with _next

diff --git a/yams/buildobjs.py b/yams/buildobjs.py
--- a/yams/buildobjs.py
+++ b/yams/buildobjs.py
@@ -267,12 +267,12 @@ class AbstractTypedAttribute(SubjectRela
         if self.metadata:
             meta = sorted(metadata.values(), key=lambda x: x.creation_rank)
             if meta[0].creation_rank < self.creation_rank:
-                previous = self
+                _previous = self
                 for _next in meta:
-                    if previous.creation_rank < _next.creation_rank:
+                    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