Author haypo
Recipients benjamin.peterson, brett.cannon, haypo, serhiy.storchaka
Date 2016-01-18.20:20:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1453148445.2.0.101816729143.issue26146@psf.upfronthosting.co.za>
In-reply-to
Content
Brett Cannon: "Would it make sense to tag the type of the constant in the node somehow?"

It's easy to get the type of a constant: type(node.value). I like using isinstance().

Brett Cannon: "We also make no backwards-compatibility guarantees about the AST, so if it simplifies things to switch entirely to Constant from Num, etc. then I said do it."

Oh, I forgot an important point from the PEP: "[ast.Constant] does not contain line number and column offset informations on tuple or frozenset items." I don't know if it's an issue or not.

I prefer to move step by step. As I wrote, we can decide to use directly ast.Constant later, even before the Python 3.6 release.
History
Date User Action Args
2016-01-18 20:20:45hayposetrecipients: + haypo, brett.cannon, benjamin.peterson, serhiy.storchaka
2016-01-18 20:20:45hayposetmessageid: <1453148445.2.0.101816729143.issue26146@psf.upfronthosting.co.za>
2016-01-18 20:20:45haypolinkissue26146 messages
2016-01-18 20:20:45haypocreate