Issue 1169: unify symbols and var
http://code.google.com/p/sympy/issues/detail?id=1169
Comment #14 by ondrej.certik:
Sure. Apply this patch:
$ git di
diff --git a/sympy/core/symbol.py b/sympy/core/symbol.py
index 5e3f134..1e2e266 100644
--- a/sympy/core/symbol.py
+++ b/sympy/core/symbol.py
@@ -256,6 +256,8 @@ def var(*names, **kwargs):
try:
kwargs['single_character_names'] = False
s = symbols(*names, **kwargs)
import pdb
pdb.set_trace()
if s is None:
return s
if isinstance(s, Symbol):
start isympy, run:
In [1]: symbols('x', 'y', real=True)
Out[1]: [x, y]
In [2]: var('x', 'y', real=True)
256 try:
257 kwargs['single_character_names'] = False
258 s = symbols(*names, **kwargs)
259 import pdb
260 pdb.set_trace()
261 -> if s is None:
262 return s
263 if isinstance(s, Symbol):
264 s_list = [s]
265 else:
266 s_list = s
(Pdb) p s
x
(Pdb) p names
('x', 'y')
(Pdb) p kwargs
{'real': True, 'single_character_names': False}
(Pdb)
and I hope it's clear now --- the other branch in symbols() gets executed
with
single_character_names() and that doesn't handle the symbols("x", "y")
syntax.
Do you think you could also please write regular tests for symbols()? I
didn't find
any. If something is still not clear, feel free to ask.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---