sup Python you okay bro

Apr 17, 2024 21:44

What do you think this does:

class A(object):
 def aa(self):
 return 'A1'
class A(object):
 def aa(self):
 return 'A2'
a = A()
print("%s" % a.aa())

It prints "A2".

But before you think "what's the big deal, the __dict__ of A is getting updated", how about this:

class A(object):
 def aa(self):
 return 'A1'
class A(object):
 def bb(self ( Read more... )

Leave a comment

Comments 1

john_archer April 19 2024, 10:48:38 UTC

Not sure if the last sentence wasn't supposed to read "This is amazingly dark"

Reply


Leave a comment

Up