[gobject-introspection] ast: Add a quick __repr__ to Field and Member



commit 71bc26058124b2b9f2e283eeb07fae5eb3e52710
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Feb 3 10:07:23 2013 -0500

    ast: Add a quick __repr__ to Field and Member
    
    Nothing too specific, just something to help with debugging.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693098

 giscanner/ast.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/giscanner/ast.py b/giscanner/ast.py
index aae9ee2..f3639fe 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -824,6 +824,8 @@ class Member(Annotated):
     def __cmp__(self, other):
         return cmp(self.name, other.name)
 
+    def __repr__(self):
+        return '%s(%r)' % (self.__class__.__name__, self.name)
 
 
 class Compound(Node, Registered):
@@ -879,6 +881,9 @@ class Field(Annotated):
     def __cmp__(self, other):
         return cmp(self.name, other.name)
 
+    def __repr__(self):
+        return '%s(%r)' % (self.__class__.__name__, self.name)
+
 
 class Record(Compound):
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]