[Python-bugs-list] [ python-Bugs-766891 ] oct() function does not represent zero correctly

SourceForge.net noreply@sourceforge.net
Mon, 07 Jul 2003 22:46:18 -0700


Bugs item #766891, was opened at 2003-07-06 19:35
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=766891&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Joshua Biagio (roehnan)
Assigned to: Nobody/Anonymous (nobody)
Summary: oct() function does not represent zero correctly

Initial Comment:
Under python 2.3b2, the oct() function does not 
return '00' for 0 as the grammar specifies, but simply '0'. 
I believe this to be a bug because the hex() function 
returns '0x0' for zero.

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

>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-07-08 00:46

Message:
Logged In: YES 
user_id=80475

The grammar does specify "0" followed by one or more 
octdigits; however, that serves only to tell the interpreter 
how to convert a string into an internal representation.  
Since "00" and "0" unambiguously convert to zero, there is 
no harm with the current situation.  On the contrary, 
attempts to "repair" this one may hurt existing programs 
relying on the current behavior.

I recommend marking this one as Won't Fix.


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

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