Ticket #1440: redef_substi.changeset

File redef_substi.changeset, 966 bytes (added by broune, 14 years ago)
Line 
1# HG changeset patch
2# User Bjarke Hammersholt Roune (www.broune.com)
3# Date 1210460321 -7200
4# Node ID 03aa09f134ea03bb60e533a106688c50aedc24ce
5# Parent  13a377fb7ead03a6a0be6a9f7884446889e7fb8e
6Made Polynomial redefine substitute in addition to subs, as it ought to.
7
8diff -r 13a377fb7ead -r 03aa09f134ea sage/rings/polynomial/polynomial_element.pyx
9--- a/sage/rings/polynomial/polynomial_element.pyx      Tue Apr 22 05:46:59 2008 -0700
10+++ b/sage/rings/polynomial/polynomial_element.pyx      Sun May 11 00:58:41 2008 +0200
11@@ -281,6 +281,18 @@
12         if right == 0:
13             return self.parent()(0)
14         return self * self.parent()(right)
15+
16+    def substitute(self, *x, **kwds):
17+        r"""
18+       This is an alias for self.subs
19+
20+        EXAMPLES:
21+            sage: R.<x> = QQ[]
22+            sage: f = x^3 + x - 3
23+            sage: f.subs(x=5)
24+            127
25+        """
26+        return self.subs(*x, **kwds)
27 
28     def subs(self, *x, **kwds):
29         r"""