by progval · 3y ago · 0 comments
Like this?
>>> class MyClass:
... attr = 0
...
>>> my_object = MyClass()
>>> MyClass.attr = 42
>>> my_object.attr
42
>>> MyClass.method = lambda self: self.attr
>>> my_object.method()
42
> When an error occurs you can inspect local variables in any of the stack frames and execute commands in themWhat is the difference with https://lukeplant.me.uk/blog/posts/pythons-disappointing-sup... ?
There are probably some subtleties and differences in how powerful both systems are (can't say more, I don't know how powerful python's metaprogramming is), but just know that Lisp has practically no limit in how you can extend the language.