var list with only one variable error
Hi
SageMath 8.8 notebook OS=W10
why does it fail if L has only one variable ? :
L=['sd_1']
#L=['sd_1','sd_2']
varL=var(L)
show(varL)
Hi
SageMath 8.8 notebook OS=W10
why does it fail if L has only one variable ? :
L=['sd_1']
#L=['sd_1','sd_2']
varL=var(L)
show(varL)
It seems for now you'll have to do an ugly workaround like:
sage: var(L[0] if len(L) == 1 else L)
I have opened a ticket with a proposed fix to the bug: https://trac.sagemath.org/ticket/28353
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2019-08-14 09:00:37 +0100
Seen: 364 times
Last updated: Aug 14 '19
FWIW, when I run
var(['x'])
I getTypeError: unhashable type 'list'
. Is this what you got? When reporting on a behavior please describe exactly the behavior you observed, and the behavior you expected instead.In any case, whether or not you got what I did, there seems to be a bug here in the treatment of
var()
on a single-item list or tuple.yes TypeError: unhashable type 'list' was the error I got
to avoid this error I did this little workaround: