Re: optional int- and float arguments

2017-10-03 Thread Steve D'Aprano
On Wed, 4 Oct 2017 12:17 pm, Stefan Ram wrote: > |>>> str(object='abc') > |'abc' That's probably also a bug. -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.org/mailman/listinfo/python-list

Re: optional int- and float arguments

2017-10-03 Thread Steve D'Aprano
On Wed, 4 Oct 2017 03:18 am, Stefan Ram wrote: > »int« and »float« seem to behave quite similar: > > |>>> int( x = 8 ) > |8 > |>>> float( x = 8.0 ) > |8.0 I expect that these functions taking a *named* parameter "x" is an accident that shouldn't be relied on. -- Steve “Cheer up,” they said

Re: optional int- and float arguments

2017-10-03 Thread Chris Angelico
On Wed, Oct 4, 2017 at 3:18 AM, Stefan Ram wrote: > »int« and »float« seem to behave quite similar: > > |>>> int( x = 8 ) > |8 > |>>> float( x = 8.0 ) > |8.0 > |>>> int() > |0 > |>>> float() > |0.0 > > . Yet the ways their parameters are being documented in > "The Python Library Reference, R