1

Can anyone tell why this piece of code fails:

object.__setattr__(object(), 'non-existing-attribute', 200)

But this not:

class K(object):
    pass

object.__setattr__(K(), 'non-existing-attribute', 200)
martineau
  • 119,623
  • 25
  • 170
  • 301
Oded Badt
  • 323
  • 1
  • 3
  • 11

0 Answers0