Am 30.03.2015 um 19:58 schrieb Aaron Meurer:
symbols() supports commas, so an easy thing to do here is to use the
form symbols(' t, w, x, y, z, n, k, m, p, i'), so that the left-hand
side of the assignment exactly matches the right-hand side.

Ah, I knew it could do commas but I didn't know that it allows the comma-plus-space combination as well. That's going to make replacing `from sympy.abc import ...` with `symbols('...')` easy enough (and I think I'll fix up any existing calls as well, just to set the precedent).

Question is: Is this what we want?
grep reports 2200+ mentions of 'abc' in SymPy, that's an awful lot of work, both for fixing and for review.

My personal main motive that I even started actually doing this has been to get some more warnings out of the system - static analysis does not know about the symbols that the exec calls in sympy.abc generates.
I could imagine fixing that by rewriting sympy.abc as

a = Symbol('a')
b = Symbol('b')
...
z = Symbol('z')
A = Symbol('A')
B = Symbol('B')
...
Z = Symbol('Z')
from sympy.printing.pretty.pretty_sombology import g, G
alpha = Symbol(g('alpha'))
beta = Symbol(g('beta'))
...
omega = Symbol(g('omega'))
ALPHA = Symbol(G('ALPHA'))
ΒETA = Symbol(G('BETA'))
...
OMEGA = Symbol(G('OMEGA'))

It's dull, it's dumb, but it gets the work done, and this needs to be maintained so rarely that it shouldn't be a problem. It should also make the import of sympy.abc fast (I guess importing sympy.abc is slow because module initialization runs ~100 one-liners through the Python compiler, though I haven't checked that it is indeed as slow as `sympy/__init__.py` suggests).

However, that's just something that I came up with tonight, I'll be happy to follow whatever course people see as best.

--
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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/55199B7D.5030505%40durchholz.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to