Hacker News new | ask | show | jobs
by brap 499 days ago
Congratulations, but that's not what reflection means.

Wikipedia: "reflection is the ability of a process to examine, introspect, and modify its own structure and behavior."

Would you say inspect.getsource(func) fits the definition of reflection?

Would you say ast.parse(inspect.getsource(func)) has something to do with the AST?

1 comments

> Would you say inspect.getsource(func) fits the definition of reflection?

I would say that reflection is absolutely meaningless in an an interpreted runtime because you can always query the runtime.

> Would you say ast.parse(inspect.getsource(func)) has something to do with the AST?

It has something to do with the AST but it doesn't have much to do with reflection.