From edda1ff1eaebc41a47fa31f71b388906a8ec2ad4 Mon Sep 17 00:00:00 2001 From: Aram Dermenjian Date: Sat, 22 Apr 2017 09:06:05 -0400 Subject: [PATCH] Update doctests and error messaging --- src/sage/categories/coxeter_groups.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/sage/categories/coxeter_groups.py b/src/sage/categories/coxeter_groups.py index 677353d9918..13324d2bea0 100644 --- a/src/sage/categories/coxeter_groups.py +++ b/src/sage/categories/coxeter_groups.py @@ -592,11 +592,10 @@ def bruhat_graph(self, x=None, y=None): if x is None: x = self.one() if y is None: - fn = getattr(self, 'long_element', None) - if callable(fn): + if self.is_finite(): y = self.long_element() else: - raise TypeError("bruhat_graph() requires 2 arguments if the group is infinite") + raise TypeError("infinite groups must specify a maximal element") g = self.bruhat_interval(x,y) d = {} @@ -1218,6 +1217,19 @@ def reflection_length(self): .. SEEALSO:: :meth:`absolute_length` + + EXAMPLES:: + + sage: W = WeylGroup(['A',3]) + sage: s = W.simple_reflections() + sage: (s[1]*s[2]*s[3]).reflection_length() + 3 + + sage: W = SymmetricGroup(4) + sage: s = W.simple_reflections() + sage: (s[3]*s[2]*s[3]).reflection_length() + 1 + """ return self.absolute_length()