U iÛfËã@s6dZddlmZddlmZmZGdd„dejƒZdS)zuFixer that addes parentheses where they are required This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``.é)Ú fixer_base)ÚLParenÚRParenc@seZdZdZdZdd„ZdS)ÚFixParenTa atom< ('[' | '(') (listmaker< any comp_for< 'for' NAME 'in' target=testlist_safe< any (',' any)+ [','] > [any] > > | testlist_gexp< any comp_for< 'for' NAME 'in' target=testlist_safe< any (',' any)+ [','] > [any] > >) (']' | ')') > cCs8|d}tƒ}|j|_d|_| d|¡| tƒ¡dS)NÚtargetÚé)rÚprefixZ insert_childZ append_childr)ÚselfZnodeZresultsrZlparen©r ús