Merged revisions 61892,61900 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r61892 | mark.dickinson | 2008-03-25 15:33:23 +0100 (Tue, 25 Mar 2008) | 3 lines

  Issue #2478: Decimal(sqrt(0)) failed when the decimal context
  was not explicitly supplied.
........
  r61900 | georg.brandl | 2008-03-25 18:36:43 +0100 (Tue, 25 Mar 2008) | 2 lines

  Add Benjamin.
........
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 7c607f9..a76b505 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -1303,6 +1303,12 @@
         d = d1.max(d2)
         self.assertTrue(type(d) is Decimal)
 
+    def test_implicit_context(self):
+        # Check results when context given implicitly.  (Issue 2478)
+        c = getcontext()
+        self.assertEqual(str(Decimal(0).sqrt()),
+                         str(c.sqrt(Decimal(0))))
+
 
 class DecimalPythonAPItests(unittest.TestCase):