[Tutor] Test for type(object) == ???
boB Stepp
robertvstepp at gmail.com
Sat Feb 11 00:49:36 EST 2017
Thanks for the detailed information. I have a final really nitpicky question.
On Fri, Feb 10, 2017 at 11:27 PM, eryk sun <eryksun at gmail.com> wrote:
> On Sat, Feb 11, 2017 at 4:32 AM, boB Stepp <robertvstepp at gmail.com> wrote:
>>
>> This bit got me experimenting. Since the integer "5" is an integer
>> object instance, I am wondering why I can't do:
>>
>> py3: 5.__repr__()
>> File "<stdin>", line 1
>> 5.__repr__()
>> ^
>> SyntaxError: invalid syntax
[snip]
> The parser sees "5." as a floating point number.
I am curious as to why the caret does not point to the first
underscore after the decimal point in the error message? It is at
that precise character that the discerned syntax error occurs.
boB
More information about the Tutor
mailing list