#NEWLINE# def _create_polygon( self , length , items ) : #NEWLINE# #INDENT# rings = [ ] #NEWLINE# for r in items : #NEWLINE# #INDENT# if isinstance ( r , GEOM_PTR ) : #NEWLINE# #INDENT# rings . append ( r ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# rings . append ( self . _construct_ring ( r ) ) #NEWLINE# #UNINDENT# #UNINDENT# shell = self . _clone ( rings . pop ( 0 ) ) #NEWLINE# n_holes = ( length - 1 ) #NEWLINE# if n_holes : #NEWLINE# #INDENT# holes = get_pointer_arr ( n_holes ) #NEWLINE# for ( i , r ) in enumerate ( rings ) : #NEWLINE# #INDENT# holes [ i ] = self . _clone ( r ) #NEWLINE# holes_param = byref ( holes ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# holes_param = None #NEWLINE# #UNINDENT# return capi . create_polygon ( shell , holes_param , c_uint ( n_holes ) )