Henk-Jaap Wagenaar <wagenaarhenkj...@gmail.com> added the comment: You get what you should get: when you print obj.d, Obj.d, you will get:
<property object at 0xDEADBEEF> which is exactly what you expect: - in the first case, you assigned a property object to the dictionary at obj.__dict__, so that's what you get back when you run obj.d. - you defined a property on a class called d, and you get it when you run Obj.d If you run print(Obj().d) you will get a TypeError: your lambda should read: lambda self: print('called') Properties should be added to the class not the instance, see https://stackoverflow.com/questions/1325673/how-to-add-property-to-a-class-dynamically and https://eev.ee/blog/2012/05/23/python-faq-descriptors/ ---------- nosy: +Henk-Jaap Wagenaar _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31735> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com