# If the field is an external typedef, we cannot be sure about the type,
# so do conversion ourself rather than rely on the CPython mechanism (through
# a property; made in AnalyseDeclarationsTransform).
- if dest_scope.is_c_class_scope and self.c_visibility == 'public':
+ if (dest_scope.is_c_class_scope
+ and self.visibility in ('public', 'readonly')):
need_property = True
else:
need_property = False
# else:
# entries[binding.name] = entry
if not shadow:
- entries[binding.name] = entry
+ entries[binding.name] = entry
entry.scope = self
return entry
print("...entry %s %s" % (entry.name, entry))
print("......type = ", entry.type)
print("......binding.c_visibility = ", entry.c_visibility)
- print("......binding.visibility = ",
- entry.python.binding.visibility)
+ print("......binding.visibility = ", entry.visibility)
self.check_c_class(entry)
def check_c_functions(self):
if binding.name == "__weakref__":
error(pos, "Special attribute __weakref__ cannot be exposed to Python")
if not type.is_pyobject:
- #print 'XXX', binding.name, binding.c_visibility == 'extern', binding.c_visibility, binding.visibility, type.create_to_py_utility_code(self), type.__class__ ####### XXXXX BUG! (cimportfrom_T248)
if not type.create_to_py_utility_code(self):
- #print 'XXX', binding.name, binding.c_visibility == 'extern', binding.c_visibility, binding.visibility ####### XXXXX BUG! (cimportfrom_T248)
error(pos,
"C attribute of type '%s' cannot be accessed from Python" % type)
return entry
entry = self.declare(binding, py_object_type, pos = pos)
entry.is_property = 1
entry.doc = doc
- # WTK: TODO: adjust PropertyScope attributes
entry.scope = PropertyScope(binding.name,
outer_scope = self.global_scope(), parent_scope = self)
entry.scope.parent_type = self.parent_type