Cajetan Rodrigues <caje...@gmail.com> added the comment:

> these interpret the number as decimal

I'm no linguist, but I feel both expressions in the subordinate clause have 
their purposes, with respect to the the main clause:

* `int('0144') == 144` to show what works
* `int('0x144')` to show what does not work

I don't believe the octal notation was meant in the first example, as the 
equality wouldn't then hold, even if somehow the typecast worked (which it 
doesn't). The point was to positively reinforce the idea that the content of 
the string would be interpreted as a decimal. So something like 
`int('000000144') == 144` would still hold True. Negative reinforcement is 
provided in the second example.

But I agree that the sentence itself does not clearly separate the two 
examples, so I would suggest adding a comma after the first example, like so:

> By default, these interpret the number as decimal, so that `int('0144') == 
> 144`, and `int('0x144')` raises ValueError.

----------
nosy: +cajetan.rodrigues

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40340>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to