125125 from htmlentitydefs import name2codepoint
126126
127127# "void elements" (no closing tag) from the HTML Standard section 12.1.2
128- VOID_ELEMENTS = set ([ 'area' , 'base' , 'br' , 'col' , 'embed' , 'hr' , 'img' , 'input' , 'keygen' ,
129- 'link' , 'menuitem' , 'meta' , 'param' , 'source' , 'track' , 'wbr' ])
128+ VOID_ELEMENTS = { 'area' , 'base' , 'br' , 'col' , 'embed' , 'hr' , 'img' , 'input' , 'keygen' ,
129+ 'link' , 'menuitem' , 'meta' , 'param' , 'source' , 'track' , 'wbr' }
130130
131131# Python 2 -> 3 compatibility
132132try :
@@ -146,7 +146,7 @@ def __init__(self, target=None):
146146 self .__builder = target or ET .TreeBuilder ()
147147
148148 def handle_starttag (self , tag , attrs ):
149- attrs = dict (( k , v or '' ) for k , v in attrs )
149+ attrs = { k : v or '' for k , v in attrs }
150150 self .__builder .start (tag , attrs )
151151 if tag in VOID_ELEMENTS :
152152 self .__builder .end (tag )
@@ -155,7 +155,7 @@ def handle_endtag(self, tag):
155155 self .__builder .end (tag )
156156
157157 def handle_startendtag (self , tag , attrs ):
158- attrs = dict (( k , v or '' ) for k , v in attrs )
158+ attrs = { k : v or '' for k , v in attrs }
159159 self .__builder .start (tag , attrs )
160160 self .__builder .end (tag )
161161
0 commit comments