[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-24 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Oh, I didn't expect that.  That is so cool!  Thanks Mariatta.  :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

I merged the PR, backported it to 3.5 and 3.6, and added Cheryl to Misc/ACKS.

Thanks everyone :)

--
resolution:  -> fixed
stage: backport needed -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 9eb5ca0774f94215be48442100c829db2484e146 by Mariatta in branch 
'master':
bpo-29751: add Cheryl Sabella to Misc/ACKS (GH-1268)
https://github.com/python/cpython/commit/9eb5ca0774f94215be48442100c829db2484e146


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset ea0efa3bc1d0b832da75519c6f85d767ae44feda by Mariatta in branch 
'3.6':
[3.6] bpo-29751: Improve PyLong_FromString documentation (GH-915) (#1266)
https://github.com/python/cpython/commit/ea0efa3bc1d0b832da75519c6f85d767ae44feda


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset d51d093b9bbca108f59bad0f1730c48ebf5b2e14 by Mariatta in branch 
'3.5':
[3.5] bpo-29751: Improve PyLong_FromString documentation (GH-915) (#1267)
https://github.com/python/cpython/commit/d51d093b9bbca108f59bad0f1730c48ebf5b2e14


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +1380

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +1379

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +1378

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage: patch review -> backport needed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-23 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 26896f2832324dde85cdd63d525571ca669f6f0b by Mariatta (csabella) 
in branch 'master':
bpo-29751: Improve PyLong_FromString documentation (GH-915)
https://github.com/python/cpython/commit/26896f2832324dde85cdd63d525571ca669f6f0b


--
nosy: +Mariatta

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-01 Thread Martin Panter

Martin Panter added the comment:

Underscores are only applicable to 3.6+, but the original concern about leading 
zeros applies to 3.5.

On Git Hub I suggested dropping the details and just referring to the Lexical 
Analysis section 
 
for the details.

FWIW here is my understanding of integer literals (with base=0):

* 0x10 => hexadecimal
* 0b10 => binary
* 0o10 => octal (corresponds to 010 in Python 2)
* 01 => illegal (avoids conflict with Python 2)
* 00 => zero (special case; was treated as octal zero in Python 2)
* 10 => decimal (must not start with digit 0)

If you want to spell out the rules, in my mind there are four special prefixes, 
0x, 0b, 0o and 0, and the default is decimal if none of those prefixes apply.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-01 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Thank you.  I've added that change.

For the backporting, I think that would only be applicable to 3.6 and 3.7?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-03-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

String arguments to int are quoted int literals.  From
https://docs.python.org/3/reference/lexical_analysis.html#literals
'Underscores are ignored for determining the numeric value of the literal. They 
can be used to group digits for enhanced readability. One underscore can occur 
between digits, and after base specifiers like 0x.'

For your patch, I would summarize this by expanding 'Leading spaces are 
ignored.' to the following (in patch comment also).
"Leading spaces and single underscores after a base specifier and between 
digits are ignored."

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-03-30 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage:  -> patch review
versions: +Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-03-30 Thread Cheryl Sabella

Cheryl Sabella added the comment:

I have a pull request ready for the documentation, but I didn't understand the 
underscore usage, so I couldn't add that.

If you explain it, then I can try to add it.

--
nosy: +csabella

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-03-30 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +815

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-03-09 Thread Brett Cannon

Changes by Brett Cannon :


--
title: PyLong_FromString fails on decimals with leading zero and base=0 -> 
PyLong_FromString documentation wrong on numbers with leading zero and base=0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com