@@ -126,9 +126,9 @@ class ARRAY(BaseType.Type, BaseType.Aggregate):
126126 """
127127 def __init__ ( self , bound_1 , bound_2 , base_type , UNIQUE = False , OPTIONAL = False , scope = None ):
128128 BaseType .Type .__init__ (self , base_type , scope )
129- if not type (bound_1 ) == int :
129+ if not isinstance (bound_1 , int ) :
130130 raise TypeError ("ARRAY lower bound must be an integer" )
131- if not type (bound_2 ) == int :
131+ if not isinstance (bound_2 , int ) :
132132 raise TypeError ("ARRAY upper bound must be an integer" )
133133 if not (bound_1 <= bound_2 ):
134134 raise AssertionError ("ARRAY lower bound must be less than or equal to upper bound" )
@@ -235,17 +235,17 @@ class LIST(BaseType.Type, BaseType.Aggregate):
235235 """
236236 def __init__ ( self , bound_1 , bound_2 , base_type , UNIQUE = False , scope = None ):
237237 BaseType .Type .__init__ (self , base_type , scope )
238- if not type (bound_1 ) == int :
238+ if not isinstance (bound_1 , int ) :
239239 raise TypeError ("LIST lower bound must be an integer" )
240240 # bound_2 can be set to None
241241 self ._unbounded = False
242242 if bound_2 == None :
243243 self ._unbounded = True
244- elif not type (bound_2 ) == int :
244+ elif not isinstance (bound_2 , int ) :
245245 raise TypeError ("LIST upper bound must be an integer" )
246246 if not bound_1 >= 0 :
247247 raise AssertionError ("LIST lower bound must be greater of equal to 0" )
248- if (type (bound_2 ) == int and not (bound_1 <= bound_2 )):
248+ if (isinstance (bound_2 , int ) and not (bound_1 <= bound_2 )):
249249 raise AssertionError ("ARRAY lower bound must be less than or equal to upper bound" )
250250 # set up class attributes
251251 self ._bound_1 = bound_1
@@ -282,14 +282,14 @@ def get_loindex(self):
282282
283283 def get_hibound (self ):
284284 hibound = self ._bound_2
285- if type (hibound ) == int :
285+ if isinstance (hibound , int ) :
286286 return INTEGER (hibound )
287287 else :
288288 return hibound
289289
290290 def get_lobound (self ):
291291 lobound = self ._bound_1
292- if type (lobound ) == int :
292+ if isinstance (lobound , int ) :
293293 return INTEGER (lobound )
294294 else :
295295 return lobound
@@ -409,17 +409,17 @@ class BAG(BaseType.Type, BaseType.Aggregate):
409409 """
410410 def __init__ ( self , bound_1 , bound_2 , base_type , scope = None ):
411411 BaseType .Type .__init__ (self , base_type , scope )
412- if not type (bound_1 ) == int :
412+ if not isinstance (bound_1 , int ) :
413413 raise TypeError ("LIST lower bound must be an integer" )
414414 # bound_2 can be set to None
415415 self ._unbounded = False
416416 if bound_2 == None :
417417 self ._unbounded = True
418- elif not type (bound_2 ) == int :
418+ elif not isinstance (bound_2 , int ) :
419419 raise TypeError ("LIST upper bound must be an integer" )
420420 if not bound_1 >= 0 :
421421 raise AssertionError ("LIST lower bound must be greater of equal to 0" )
422- if (type (bound_2 ) == int and not (bound_1 <= bound_2 )):
422+ if (isinstance (bound_2 , int ) and not (bound_1 <= bound_2 )):
423423 raise AssertionError ("ARRAY lower bound must be less than or equal to upper bound" )
424424 # set up class attributes
425425 self ._bound_1 = bound_1
@@ -462,14 +462,14 @@ def get_loindex(self):
462462
463463 def get_hibound (self ):
464464 hibound = self ._bound_2
465- if type (hibound ) == int :
465+ if isinstance (hibound , int ) :
466466 return INTEGER (hibound )
467467 else :
468468 return hibound
469469
470470 def get_lobound (self ):
471471 lobound = self ._bound_1
472- if type (lobound ) == int :
472+ if isinstance (lobound , int ) :
473473 return INTEGER (lobound )
474474 else :
475475 return lobound
@@ -527,17 +527,17 @@ class SET(BaseType.Type, BaseType.Aggregate):
527527 """
528528 def __init__ ( self , bound_1 , bound_2 , base_type , scope = None ):
529529 BaseType .Type .__init__ (self , base_type , scope )
530- if not type (bound_1 ) == int :
530+ if not isinstance (bound_1 , int ) :
531531 raise TypeError ("LIST lower bound must be an integer" )
532532 # bound_2 can be set to None
533533 self ._unbounded = False
534534 if bound_2 == None :
535535 self ._unbounded = True
536- elif not type (bound_2 ) == int :
536+ elif not isinstance (bound_2 , int ) :
537537 raise TypeError ("LIST upper bound must be an integer" )
538538 if not bound_1 >= 0 :
539539 raise AssertionError ("LIST lower bound must be greater of equal to 0" )
540- if (type (bound_2 ) == int and not (bound_1 <= bound_2 )):
540+ if (isinstance (bound_2 , int ) and not (bound_1 <= bound_2 )):
541541 raise AssertionError ("ARRAY lower bound must be less than or equal to upper bound" )
542542 # set up class attributes
543543 self ._bound_1 = bound_1
@@ -581,14 +581,14 @@ def get_loindex(self):
581581
582582 def get_hibound (self ):
583583 hibound = self ._bound_2
584- if type (hibound ) == int :
584+ if isinstance (hibound , int ) :
585585 return INTEGER (hibound )
586586 else :
587587 return hibound
588588
589589 def get_lobound (self ):
590590 lobound = self ._bound_1
591- if type (lobound ) == int :
591+ if isinstance (lobound , int ) :
592592 return INTEGER (lobound )
593593 else :
594594 return lobound
0 commit comments