why sqrt is not a built-in function?

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Jan 15 21:41:03 EST 2021


On 16/01/21 10:14 am, Michael F. Stemper wrote:
> I had no idea that syntax existed, and find it completely at odds
> with The Zen of Python.

It's not an *obvious* way, so there's no Zen conflict.

As for why it exists, it's part of the mechanism that implements
imports -- 'import' statements get compiled into a call to
__import__.

It also provides a way of importing something specifed by a
string at runtime, so it can be useful.

-- 
Greg



More information about the Python-list mailing list