[Python-bugs-list] [ python-Bugs-634069 ] Errors in ** docs

noreply@sourceforge.net noreply@sourceforge.net
Thu, 07 Nov 2002 11:14:26 -0800


Bugs item #634069, was opened at 2002-11-05 16:32
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=634069&group_id=5470

Category: Documentation
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim Peters (tim_one)
>Assigned to: Raymond Hettinger (rhettinger)
Summary: Errors in ** docs

Initial Comment:
Section 5.4 "The power operator" is out of date:

1. Raising a postive int to a negative int power no longer 
raises TypeError (it returns a float).

2. It's unclear what "a broken power" means.  Raising a 
negative float to a non-integer power raises ValueError 
(not TypeError), if that's what it means.

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2002-11-07 14:14

Message:
Logged In: YES 
user_id=6380

How do the docs for true division currently describe the
results?  If they say that with true division, int/int (and
long/long and int/long etc.) returns a float, it's okay for
the ** operator to say the same.

In any case, I doubt that either of these will ever return a
rational unless at least one of the arguments is a rational.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2002-11-07 14:05

Message:
Logged In: YES 
user_id=31435

Thanks, Raymond.  I believe it accurately describes the 
CPython implementation today, but assigning to Guido so he 
can ponder whether this is how the language is defined (e.g., 
perhaps he wants to leave the door open for 2**-2 to return 
1r/4 someday -- or perhaps not).

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2002-11-07 01:58

Message:
Logged In: YES 
user_id=80475

Tim, how does this patch look to you?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=634069&group_id=5470