The symbols() function is designed to be a convenience function to
make it easy to define many symbols at once. Since an empty symbol is
not something virtually anyone would want to make, it is disallowed.
Something like symbols('a,,b') is more likely to be a typo than
intentional.
However, you can still create symbols manually using the Symbol
constructor. Symbol itself allows any string at all, including the
empty string or strings containing unicode characters.
The empty string does work, although you're likely to run into
printing problems if you use it. For example, you can see that latex()
generates invalid latex because it assumes the symbol name is not
empty.
>>> Symbol("")
>>> srepr(Symbol(""))
"Symbol('')"
>>> latex(Symbol("")**2)
'^{2}'
This is sort of a "bug", but honestly not a very important one. The
printers mostly just assume symbol names are legal names for whatever
language they print to without actually checking.
I'm afraid I am not really following your suggestion about ~ or
spaces. In general, I would avoid using spaces or strange characters
in symbol names, as it would be unexpected and could potentially break
things like the latex printer, but like I said, Symbol itself does not
prevent you from putting any string you want.
Aaron Meurer
> --
> 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+un...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/b76513c2-20bd-4714-b379-6a23dadfb0b7n%40googlegroups.com.