[Python-Dev] Why is nb_inplace_power ternary? (original) (raw)

Thomas Wouters thomas at python.org
Wed Feb 14 16:30:19 CET 2007


The same way += et al. are in-place: it would ask 'x' to modify itself, if it can. If not, no harm done. (It would be called as 'x = ipow(x, n, 10)' of course, just like 'x += n' is really 'x = x.iadd(n)')

On 2/10/07, "Martin v. Löwis" <martin at v.loewis.de> wrote:

Greg Ewing schrieb: >> What could the syntax for that be? > > It wouldn't be a syntax, just a function, e.g. > > ipow(x, n, 10) In what way would that be inplace? A function cannot rebind the variables it gets as parameters. Regards, Martin


Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/thomas%40python.org

-- Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-dev/attachments/20070214/ee026245/attachment.html



More information about the Python-Dev mailing list