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

Bruce Sass bsass at freenet.edmonton.ab.ca
Wed Jul 25 17:31:18 EDT 2001


How nasty would it be to allow one to do...

>>> int(a), b = divmod(5.01, 2)
>>> print a, b
2 1.01

...instead of the current...

>>> int(a), b = divmod(5.01, 2)
SyntaxError: can't assign to function call


On the surface, it looks as simple as postponing the function call
until after the assignment.  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?


- Bruce





More information about the Python-list mailing list