Re: [pygccxml-development] Recent Py++ modifications...
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2006-09-18 19:04:29
|
On 9/18/06, Matthias Baas <ba...@ir...> wrote:
> I created a small test file that demonstrates the problem. While doing
> so, I noticed that the problem only exists when I manually add the copy
> constructor to the bindings (which is what I'm doing for the Maya bindings).
Thank you for small test case. I was able to reproduce the bug. To
tell you the true
I don't know what I should do and how I should fix the situation. The
changes we are
talking about does not change the logic of creation "implicitly_convertible".
This is the code that has been used to find out whether Py++ needs to generate
i.c.:
if not self._is_constructor_of_abstract_class( self.curr_decl ) \
and 1 == len( self.curr_decl.arguments ) \
and self.__create_castinig_constructor \
and self.curr_decl.access_type == ACCESS_TYPES.PUBLIC:
maker = code_creators.casting_constructor_t( constructor=self.curr_decl )
self.__module_body.adopt_creator( maker )
Now it looks a little bit different:
if self.curr_decl.allow_implicit_conversion:
maker = code_creators.casting_constructor_t( constructor=self.curr_decl )
self.__module_body.adopt_creator( maker )
where allow_implicit_conversion defined as :
def _get_allow_implicit_conversion(self):
return self._allow_implicit_conversion and
self.does_define_implicit_conversion()
def does_define_implicit_conversion( self ):
if self.parent.is_abstract: #user is not able to create an
instance of the class
return False
if self.is_copy_constructor:
return False
if 1 != len( self.arguments ):
return False
if self.parent.find_out_member_access_type( self ) !=
declarations.ACCESS_TYPES.PUBLIC:
return False
return True
I don't see the change in a logic, may you do? Anyway I think that the
problem is
in Boost.Python. I will report it the mailing list.
The solution to your problem is simple: don't allow implicit conversion:
constr.allow_implicit_conversion = False
This should solve it.
If you have any ideas, what I should to - please tell me.
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|