Jonathan Fine <jfine2...@gmail.com> added the comment:
Here's the essence of a patch. Suppose the input is Python integers, and the output is a mathematical integer. In this case we can make the output a Python integer by using the helper function >>> def wibble(p, q): ... if type(p) == type(q) == int and p%q == 0: ... return p // q ... else: ... return p / q ... >>> wibble(4, 2) 2 >>> wibble(3, 2) 1.5 This will also work for average. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35698> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com