Beispiel #1
0
 def getattr(p, s_attr):
     if s_attr.is_constant() and isinstance(s_attr.const, str):
         # XXX kill with extfunctable.py
         if p.knowntype in builtin.EXTERNAL_TYPE_ANALYZERS:
             return SomeObject.getattr(p, s_attr)
         
         attr = s_attr.const
         entry = extregistry.lookup_type(p.knowntype)
         s_value = entry.get_field_annotation(p.knowntype, attr)
         return s_value
     else:
         return SomeObject()
Beispiel #2
0
 def getattr(s_array, s_attr):
     s = None
     if s_attr.is_constant() and isinstance(s_attr.const, str):
         attr = s_attr.const
         if attr == 'shape':
             s = SomeTuple([SomeInteger()] * s_array.ndim)
         elif attr == 'ndim':
             s = SomeInteger()
         elif attr == 'dtype':
             s = SomeChar()
     if s is None:
         return SomeObject.getattr(s_array, s_attr)
     return s
Beispiel #3
0
 def getattr(s_array, s_attr):
     s = None
     if s_attr.is_constant() and isinstance(s_attr.const, str):
         attr = s_attr.const
         if attr == 'shape':
             s = SomeTuple([SomeInteger()]*s_array.ndim)
         elif attr == 'ndim':
             s = SomeInteger()
         elif attr == 'dtype':
             s = SomeChar()
     if s is None:
         return SomeObject.getattr(s_array, s_attr)
     return s