Hacker News new | ask | show | jobs
by NoahTheDuke 1628 days ago
> This jaw-droppingly moronic.

It can be slightly inconvenient but doesn’t feel moronic to me. It means that except for the built-in functions, everything can be traced to either a definition or an import. Makes tracking code much easier.

1 comments

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.
"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.