@@ -627,7 +627,7 @@ class I_(Predefined, SympyObject):
627627 name = "I"
628628 sympy_name = "I"
629629 sympy_obj = sympy .I
630- summary_text = "imaginary unit"
630+ summary_text = "imaginary unit number Sqrt[-1] "
631631 python_equivalent = 1j
632632
633633 def is_constant (self ) -> bool :
@@ -658,7 +658,7 @@ class Im(SympyFunction):
658658 = -Graphics-
659659 """
660660
661- summary_text = "imaginary part"
661+ summary_text = "imaginary part of a complex number "
662662 attributes = A_LISTABLE | A_NUMERIC_FUNCTION | A_PROTECTED
663663
664664 def eval_complex (self , number , evaluation : Evaluation ):
@@ -817,10 +817,14 @@ class Re(SympyFunction):
817817 = -Graphics-
818818 """
819819
820- summary_text = "real part"
820+ summary_text = "real part of a complex number "
821821 attributes = A_LISTABLE | A_NUMERIC_FUNCTION | A_PROTECTED
822822 sympy_name = "re"
823823
824+ def eval (self , number , evaluation : Evaluation ):
825+ "Re[number_]"
826+ return from_sympy (sympy .re (number .to_sympy ().expand (complex = True )))
827+
824828 def eval_complex (self , number , evaluation : Evaluation ):
825829 "Re[number_Complex]"
826830 if isinstance (number , Complex ):
@@ -831,10 +835,6 @@ def eval_number(self, number, evaluation: Evaluation):
831835
832836 return number
833837
834- def eval (self , number , evaluation : Evaluation ):
835- "Re[number_]"
836- return from_sympy (sympy .re (number .to_sympy ().expand (complex = True )))
837-
838838
839839class Real_ (Builtin ):
840840 """
@@ -987,8 +987,8 @@ class Sum(IterationFunction, SympyFunction):
987987 }
988988 )
989989
990- def get_result (self , items ) :
991- return Expression (SymbolPlus , * items )
990+ def get_result (self , elements ) -> Expression :
991+ return Expression (SymbolPlus , * elements )
992992
993993 def to_sympy (self , expr , ** kwargs ) -> Optional [SympyExpression ]:
994994 """
0 commit comments