fixed doctest issues

This commit is contained in:
Dave Halter
2014-01-12 02:23:35 +01:00
parent 0bff729294
commit 7a0dc41b62
2 changed files with 5 additions and 2 deletions

View File

@@ -128,7 +128,7 @@ class Evaluator(object):
true (default).
>>> pairs[2] #doctest: +ELLIPSIS
(<Module: ...builtin...>, [<Name: ...>, ...])
(<Builtin: ...builtin...>, [<PyName: ...>, ...])
:rtype: [(pr.Scope, [pr.Name])]
:return: Return an generator that yields a pair of scope and names.

View File

@@ -129,8 +129,11 @@ class PyName(object):
def get_parent_until(self):
return self.parent.get_parent_until()
def __str__(self):
return self.name
def __repr__(self):
return '<%s: (%s).%s>' % (type(self).__name__, repr(self._obj.obj), self.name)
return '<%s: (%s).%s>' % (type(self).__name__, self._obj.name, self.name)
@property
@underscore_memoization