def styleof(expr, styles=default_styles):
 style = dict()
 for (typ, sty) in styles:
  if isinstance(expr, typ):
   style.update(sty)
 return style

def styleof ( expr , styles = default_styles ) : style = dict ( ) for ( typ , sty ) in styles : if isinstance ( expr , typ ) : style . update ( sty ) return style
merge style dictionaries in order .