Hacker News new | ask | show | jobs
by kazinator 1628 days ago
Why not import the built-in functions too? The only thing not requiring import can be import.

  from python import def  # now you can def
That should be even easier to track things; now you don't have to deal with the difficulty of def not being defined anywhere in your code. It's traced to an import, which is telling you that def comes from python, liberating you from having to know that and remember it.
1 comments

"def" is not a function. It's not even an identifier.
This exercise requires you to imagine a somewhat different Python in which you can (and must) do from python import def if you are to use def.
I mean, that would be Lisp, and in that context I wouldn't really have a problem with it.