Somewhat similar in spirit, I think
that functions should try to return objects of the same type,
unless explicitly called with an argument to change such behavior.
It is not just the case of int and
Integer. This might happen with Integer vs. Rational, where a
function that usually use division, might in certain conditions
returns an Integer (or more generally, an element of an integral
domain rather than an element of the fraction field).
Of course there is nuance. For example,
the 'binomial' function coerce its arguments, or using nullable
types when there is a certificate argument, and so on.
Regards,
TB
On 12/07/2021 16:50, David Roe wrote:
You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/8caed312-d661-4836-ef96-d3b3bcc419db%40gmail.com. |
- [sage-devel] Library code returning int ... Kwankyu Lee
- [sage-devel] Re: Library code retur... Nils Bruin
- [sage-devel] Re: Library code r... 'Travis Scrimshaw' via sage-devel
- [sage-devel] Re: Library code r... Kwankyu Lee
- Re: [sage-devel] Re: Librar... David Roe
- Re: [sage-devel] Re: Li... TB
- Re: [sage-devel] Re: Li... Kwankyu Lee
- Re: [sage-devel] R... Kwankyu Lee
- Re: [sage-deve... John H Palmieri
- Re: [sage-... Kwankyu Lee