On 2016-08-18, ast <nomail@com.invalid> wrote: > Hello > > I wonder why calling a method on an integer > doesn't work ? > >>>> 123.bit_length() > SyntaxError: invalid syntax
Becuase the parser thinks you've entered a floating point number with a fractional part of "bit_length". You need to enter the integer such that it's identified by the parser as an integer rather than as a broken floating point number: >>> (123).bit_length() 7 >>> 123 .bit_length() 7 -- Grant Edwards grant.b.edwards Yow! Look DEEP into the at OPENINGS!! Do you see any gmail.com ELVES or EDSELS ... or a HIGHBALL?? ... -- https://mail.python.org/mailman/listinfo/python-list