Python in trouble 😉?

pow is a reserved word in python. ** does the same thing. this creates redundancy and is bad design. pow creates error @ compile time. (without arguments). this is BAD.

Agree Or Not ?

1 Answer

Relevance
  • 1 month ago
    Favorite Answer

    Disagree.  First off (as an earlier answer is trying to say without saying it), built-in functions are *not* reserved words in Python.  It's not a good idea to reuse them, but they can be reused if you really don't need to use that builtin. 

    Maybe your IDE won't allow running a Python program reusing pow, due to its own syntax checker, but the reference implementation (CPython, from python.org) has always allowed this.

    Second, the pow function does more than ** does.  It's got a 3-argument version that's very handy for number-theory problems (encryption, hashing, finite field transforms, etc.) and there's no easy way to extend the ** operator to accept a 3rd argument.

    The source link will get you to a list of current Python 3 keywords (aka "reserved words") and you'll see that there are no builtin function or type names; and only 3 special data value names (True, False and None).

    • Sanjay1 month agoReport

      Newbies????? 📞

    • Login to reply the answers
Still have questions? Get your answers by asking now.