Shot in the dark, but "if 1" means it will always just return result. If you
remove the entire if block, does it still not pickle? (then it isn't an
issue with the if)

On Tue, Sep 7, 2010 at 1:19 AM, smichr <smi...@gmail.com> wrote:

> I need some extra eyes. I can't see how changing the "if 1" to "if 0"
> causes pickling to fail without ever returning anything different for
> ans and result. This comes from basic.py, (the is_number method) at
> github/smichr/2052
>
>
>    @property
>    def is_number(self):
>        result = False
>        for obj in self.iter_basic_args():
>            if obj.is_number:
>                result = True
>            else:
>                result = False
>                break
>        if 1: # if 0 the lower code will calculate the result, too
>            return result
>        def my():
>            if not self.args:
>                # Atoms has its own method
>                return False
>            if all(obj.is_number for obj in self.iter_basic_args()):
>                return True
>
>            for s in self.symbols:
>                if self.diff(s).expand(mul=1): # if not zero for 1
> then not zero overall
>                    return False
>            return True
>        ans = my()
>        assert ans == result
>        return ans
>
> Does anyone have an idea of what I am missing?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to
> sympy+unsubscr...@googlegroups.com <sympy%2bunsubscr...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to