int(a), b = divmod(x, y)

Greg Ewing greg at
Wed Jul 25 23:42:24 EDT 2001

Bruce Sass wrote:
> How nasty would it be to allow one to do...
> >>> int(a), b = divmod(5.01, 2)
> Would it be a one-time hit when the
> pseudo-ops are generated, a runtime performance issue that would
> affect all function calls, just too hairy to implement, or something
> else?

Too hairy to *think* about! It looks extremely weird.
If it means anything at all, it looks like it means
"set a to some value such that int(a) == divmod(5.01, 2)[0]".
On that basis it could set a to anything from
2.0 to 2.99999999999999!

Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:

More information about the Python-list mailing list