divmod() vs .quo_rem()

36 views
Skip to first unread message

Lorenz Panny

unread,
Apr 12, 2022, 9:46:45 AM4/12/22
to sage-...@googlegroups.com

Python defines divmod() and the associated .__divmod__() magic method
for what Sage calls .quo_rem().

Is there any reason why Sage shouldn't or cannot support divmod()?

David Roe

unread,
Apr 12, 2022, 10:46:31 AM4/12/22
to sage-devel
I see no reason why Sage couldn't support divmod() in addition to quo_rem().
David

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/20220412214635.2dd69295%40l.

kcrisman

unread,
Apr 13, 2022, 7:37:21 AM4/13/22
to sage-devel
Just for reference, Sage already has divmod() (e.g. https://sagecell.sagemath.org/?q=owmsez) and returns a tuple of Sage integers, so maybe we already do?  I don't know about the magic method though.  quo_rem() was the one new to me, and doesn't actually appear to be defined - did you maybe mean the other way around?
Reply all
Reply to author
Forward
0 new messages