On Wed, Jul 22, 2015 at 1:22 PM, Hong Xu <[email protected]> wrote:
> Hi,
>
> When I tried to run
>
>
> print(sympify('a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|G|H|I|J|K|L|M|N'))
>
> I got the error:
>
>
> Traceback (most recent call last):
>   File "test.py", line 6, in <module>
>
> print(sympify('a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|G|H|I|J|K|L|M|N'))
>   File
> "/home/user/.local/lib/python3.4/site-packages/sympy/core/sympify.py", line
> 317, in sympify
>     expr = parse_expr(a, local_dict=locals, transformations=transformations,
> evaluate=evaluate)
>   File
> "/home/user/.local/lib/python3.4/site-packages/sympy/parsing/sympy_parser.py",
> line 820, in parse_expr
>     return eval_expr(code, local_dict, global_dict)
>   File
> "/home/user/.local/lib/python3.4/site-packages/sympy/parsing/sympy_parser.py",
> line 733, in eval_expr
>     code, global_dict, local_dict)  # take local objects in preference
>   File "<string>", line 1, in <module>
>   File
> "/home/user/.local/lib/python3.4/site-packages/sympy/logic/boolalg.py", line
> 34, in __or__
>     return Or(self, other)
>   File
> "/home/user/.local/lib/python3.4/site-packages/sympy/core/operations.py",
> line 404, in __new__
>     _args = frozenset(cls._new_args_filter(args))
>   File
> "/home/user/.local/lib/python3.4/site-packages/sympy/logic/boolalg.py", line
> 374, in _new_args_filter
>     for x in args:
>   File
> "/home/user/.local/lib/python3.4/site-packages/sympy/core/operations.py",
> line 402, in <genexpr>
>     args = (_sympify(arg) for arg in args)
>   File
> "/home/user/.local/lib/python3.4/site-packages/sympy/core/sympify.py", line
> 350, in _sympify
>     return sympify(a, strict=True)
>   File
> "/home/user/.local/lib/python3.4/site-packages/sympy/core/sympify.py", line
> 272, in sympify
>     raise SympifyError(a)
> sympy.core.sympify.SympifyError: SympifyError: <function N at
> 0x7f3e5c913620>
>
> Is there a hard coded number of variables sympify can handle, or a different
> reason?

The error you see seem to be coming from the last symbol you have,
"N". If I replace it by "K" (say):

>>> print(sympify('a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|G|H|I|J|K|L|M|K'))
Or(A, B, C, D, E, F, G, H, I, J, K, L, M, a, b, c, d, e, f, g, h, i,
j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)

sympy has a function, "N":
>>> sympy.N
<function N at 0x7f2437adfb70>
>>> sympy.N.__module__
'sympy.core.evalf'


Best,
Amit.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CANODV3kSYe5_p34b6fZLEyvYjUieoHOr3q-iSB5ckbKYSvyv1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to