Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/sys/lib/python2.7/lib2to3/fixes/fix_set_literal.pyo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�`^c@sOdZddlmZmZddlmZmZdejfd��YZdS(s:
Optional fixer to transform set() calls to set literals.
i�(t
fixer_basetpytree(ttokentsymst
FixSetLiteralcBs#eZeZeZdZd�ZRS(sjpower< 'set' trailer< '('
                     (atom=atom< '[' (items=listmaker< any ((',' any)* [',']) >
                                |
                                single=any) ']' >
                     |
                     atom< '(' items=testlist_gexp< any ((',' any)* [',']) > ')' >
                     )
                     ')' > >
              c	Cs|jd�}|rItjtj|j�g�}|j|�|}n
|d}tjtj	d�g}|j
d�|jD��|jtjtj
d��|jj|d_tjtj|�}|j|_t|j�dkr|jd}|j�|j|jd_n|S(	Ntsingletitemsu{css|]}|j�VqdS(N(tclone(t.0tn((s3/sys/lib/python2.7/lib2to3/fixes/fix_set_literal.pys	<genexpr>'su}i�ii(tgetRtNodeRt	listmakerRtreplacetLeafRtLBRACEtextendtchildrentappendtRBRACEtnext_siblingtprefixtdictsetmakertlentremove(	tselftnodetresultsRtfakeRtliteraltmakerR	((s3/sys/lib/python2.7/lib2to3/fixes/fix_set_literal.pyt	transforms"
	


(t__name__t
__module__tTruet
BM_compatibletexplicittPATTERNR(((s3/sys/lib/python2.7/lib2to3/fixes/fix_set_literal.pyRs
N(	t__doc__tlib2to3RRtlib2to3.fixer_utilRRtBaseFixR(((s3/sys/lib/python2.7/lib2to3/fixes/fix_set_literal.pyt<module>s

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].