# HG changeset patch
# User William Stein <wstein@gmail.com>
# Date 1180199423 25200
# Node ID e16a1246ff7081363ecc70fef69ce834543693da
# Parent  2c2c1cf66b6f87869a8d42dc75ca7d30ea4f2992
Implement __divmod__ special method (suggested by Pablo De Napoli)

diff -r 2c2c1cf66b6f -r e16a1246ff70 sage/structure/element.pyx
--- a/sage/structure/element.pyx	Sat May 26 09:34:42 2007 -0700
+++ b/sage/structure/element.pyx	Sat May 26 10:10:23 2007 -0700
@@ -1745,6 +1745,16 @@ cdef class EuclideanDomainElement(Princi
     def quo_rem(self, other):
         raise NotImplementedError
 
+    def __divmod__(self, other):
+        """
+        Return the quotient and remainder of self divided by other.
+        
+        EXAMPLES:
+            sage: divmod(5,3)
+            (1, 2)
+        """
+        return self.quo_rem(other)
+
     def __floordiv__(self,right):
         """
         Quotient of division of self by other.  This is denoted //.
