You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.
The current implementation seems pretty hacky and brittle.
For one, LetterWithSubscripts('x', 1, 2) == LetterWithSubscripts('x_1_2') == LetterWithSubscripts('x', '1_2'). According to @Strilanc, this is necessary because of how poorly Sympy treats subclasses of sympy.Symbol.
One possible alternative replace the class entirely with a function letter_with_subscripts that returns a sympy.Symbol object directly with the right name. The function could set the letter and subscripts attributes of the object, but that might not play well with mypy.
The text was updated successfully, but these errors were encountered:
If it's left as is, the inputs should at least be validated or parsed so that LetterWithSubscripts('x_1_2') either throws an error or evaluates to LetterWithSubscripts('x', 1, 2).
The current implementation seems pretty hacky and brittle.
For one,
LetterWithSubscripts('x', 1, 2) == LetterWithSubscripts('x_1_2') == LetterWithSubscripts('x', '1_2')
. According to @Strilanc, this is necessary because of how poorly Sympy treats subclasses ofsympy.Symbol
.One possible alternative replace the class entirely with a function
letter_with_subscripts
that returns asympy.Symbol
object directly with the right name. The function could set theletter
andsubscripts
attributes of the object, but that might not play well with mypy.The text was updated successfully, but these errors were encountered: