🌐 AI搜索 & 代理 主页
Skip to content

Commit 7ccfe91

Browse files
author
Cameron Currie
committed
Implement __repr__
1 parent 1eccede commit 7ccfe91

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

coderwall.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(self, username):
6060
raise NameError(self.username + ' does not appear to be a CoderWall user')
6161

6262
def __repr__(self):
63-
return self.__str__() # NOTE Does not conform to standards
63+
return "CoderWall(username=%r)" % (self.username)
6464

6565
def __str__(self):
6666
return self.name + ' (' + self.username + '), ' + self.location + ', Endorsed ' + str(self.endorsements) + ' times: ' + str(self.badges)
@@ -84,7 +84,7 @@ def __init__(self, name, description, image_uri):
8484
self.image_uri = image_uri
8585

8686
def __repr__(self):
87-
return self.__str__() # NOTE Does not conform to standards
87+
return "Badge(name=%r,description=%r,image_uri=%r)" % (self.name, self.description, self.image_uri)
8888

8989
def __str__(self):
9090
return self.name + ': ' + self.description

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='coderwall',
5-
version='1.0.0',
5+
version='1.1.0',
66
author='Cameron Currie',
77
author_email='me@cameroncurrie.net',
88
url='http://github.com/cwc/coderwall-python',

0 commit comments

Comments
 (0)