[nodes] remove id(obj) in reprs

It just degrades the readability for no apparent benefit.

Closes #190394.

authorAurelien Campeas <aurelien.campeas@logilab.fr>
changeset3d5a9d57cf95
branchdefault
phasepublic
hiddenno
parent revision#4e574315c418 merge changes from stable
child revision#0c8840b3be04 add pygments lexer to colorize query strings (closes #34252)
files modified by this revision
nodes.py
# HG changeset patch
# User Aurelien Campeas <aurelien.campeas@logilab.fr>
# Date 1382372611 -7200
# Mon Oct 21 18:23:31 2013 +0200
# Node ID 3d5a9d57cf951e7cb3fb537190e5b57ea1f86fe0
# Parent 4e574315c4186fe9b4637472048383427e3cb1e7
[nodes] remove id(obj) in reprs

It just degrades the readability for no apparent benefit.

Closes #190394.

diff --git a/nodes.py b/nodes.py
@@ -822,11 +822,11 @@
1      def as_string(self, encoding=None, kwargs=None):
2          """return the tree as an encoded rql string"""
3          return self.name
4 
5      def __repr__(self):
6 -        return 'VarRef(%#X) to %r' % (id(self), self.variable)
7 +        return 'VarRef(%r)' % self.variable
8 
9      def __cmp__(self, other):
10          return not self.is_equivalent(other)
11 
12      def register_reference(self):
@@ -1092,11 +1092,11 @@
13          super(ColumnAlias, self).__init__(alias)
14          self.colnum = int(colnum)
15          self.query = query
16 
17      def __repr__(self):
18 -        return 'alias %s(%#X)' % (self.name, id(self))
19 +        return 'alias %s' % self.name
20 
21      def get_type(self, solution=None, kwargs=None):
22          """return entity type of this object, 'Any' if not found"""
23          vtype = super(ColumnAlias, self).get_type(solution, kwargs)
24          if vtype == 'Any':
@@ -1129,8 +1129,8 @@
25      collects information about a variable use in a syntax tree
26      """
27      __slots__ = ('_q_invariant', '_q_sql', '_q_sqltable') # XXX ginco specific
28 
29      def __repr__(self):
30 -        return '%s(%#X)' % (self.name, id(self))
31 +        return '%s' % self.name
32 
33