String To Dict Problem

Clodoaldo Pinto clodoaldo.pinto at gmail.com
Sat Apr 22 07:35:44 EDT 2006


Michael Spencer wrote:

> Alternatively, you could edit visitName to allow 'True' and any other
> identifiers you specify e.g. (untested):
>
>      allowed = {"True": True, "False": False}
>      def visitName(self,node, **kw):
> 	try:
>              return self.allowed[node.name]
>          except KeyError:
>              raise Unsafe_Source_Error("Strings must be quoted",
>                                   node.name, node)
>

Thank you both Michael and Felipe. The solutions work great!

Regards, Clodoaldo




More information about the Python-list mailing list