Greg Ewing schrieb:
> Might we want to add an in-place version of the 3-arg
> pow() function one day? If so, leaving the third argument
> there could be useful.

"Martin v. Löwis" martin at v.loewis.de replied:
> What could the syntax for that be?

> Instead of writing

> x = pow(x, n, 10)

Either

x**= n % 10             # The **= changes the parse context, so that %
is no longer
                                # immediately evaluated
or

x**= (n, 10)              # exponentiation to a tuple isn't currently
defined, and it
                                # does show that both arguments are
part of the power
                                # expression -- but I'm not sure it
needs a 3-argument form
                                # instead of just unpacking the tuple itself.

-jJ
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to