Steven D'Aprano writes: > But I don't think it would be a big problem unless the caller was mixing > calls to gamma with int and float arguments.
You mean `factorial` here, right? `gamma` coerces int to float before evaluating, doesn't it? > If you stick to one or the other, it wouldn't matter. Users who are disciplined enough to stick to one or the other will use factorial when appropriate, and gamma when that's appropriate. The point of the proposal is to allow the less pedantic to not worry about the difference, and just use `factorial`. Horrifying thought to those of us for whom "pedantic" is a term of praise :-), "although practicality beats purity" :-P . > Or if we had automatic simple type dispatch, we could define: > > def factorial(n: int) -> int: > # current integer-only implementation > > def factorial(x: float) -> float: > return x*gamma(x) > > and nobody would care that the two factorial functions had different > performance and precision characteristics. Except that it would still be the case that >>> factorial(23) == factorial(23.0) False For me, that kills that idea. It's impractical! Other Steve _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/ZX2WXAKTVWKZE2NHE2WWPOMG45SPTCVL/ Code of Conduct: http://python.org/psf/codeofconduct/