inducer / pymbolic

A simple package to do symbolic math (focus on code gen and DSLs)
http://mathema.tician.de/software/pymbolic
Other
107 stars 25 forks source link

Correctly stringify tuple subscripts. #2

Closed dham closed 10 years ago

dham commented 10 years ago

Python turns multiple subscripts separated by commas into a tuple of subscripts. When stringifying this, Pymbolic inserts the set of parentheses associated with that tuple inside the square brackets for the subscript. This commit causes Pymbolic to suppress these parentheses.

That is to say, instead of an output which looks like:

phi[(a, b)]

we now get:

phi[a, b]

inducer commented 10 years ago

Thanks!