RustPython / Parser

MIT License
72 stars 28 forks source link

Implement `ToString` for `Identifier` and `Constant` #28

Closed MichaReiser closed 1 year ago

MichaReiser commented 1 year ago

Would it be useful to implement ToString for Identifier and Constant?

youknowone commented 1 year ago

ToString for Constant is looking very useful.

I wish Identifier can call it through Deref<Target=str>, ~but adding one will be good too if you need for optimization.~ (It will be copy anyway) (In the long term, I wish I can remove String from them through #21.)

MichaReiser commented 1 year ago

Good point, this should work already out of the box, thanks to `Deref