power TypeErrors

Bengt Richter bokr at oz.net
Tue Nov 5 21:57:37 EST 2002


On Tue, 5 Nov 2002 16:39:44 -0500, anton wilson <anton.wilson at camotion.com> wrote:
[...]
>
>It actually causes an error from a source file, only if i use a variable 
>argument to **.
>
>so this fails:
>
>x = -1
>x ** 0.5 
>
>but 
>
>-1 ** -0.5 doesn't. 
operator precedence makes that
-(1 ** -0.5)
whereas using x is like
(-1) ** 0.5

Regards,
Bengt Richter



More information about the Python-list mailing list