On Monday 16 March 2009 22:52:16 Ralf W. Grosse-Kunstleve wrote:
> [...] Boost.Python 2 was written when the Python bool type still really
> was an int (Python 2.2). [...]
On Tuesday 17 March 2009 06:40:14 Roman Yakovenko wrote:
> Python code:
>
> def foo( arg ):
> if isinstance( arg, int ):
>
isinstance( True, int ) returns True
However, the code
def foo( arg ):
if isinstance( arg, bool ):
_foo_bool( arg )
else:
_foo_other( arg )
Would work in theory.
I could do this. I'm just annoyed that BP is not doing it for me.
-Original Message-
From:
I have a quasi-fix for this to the library itself, (see diff below)
buuut it breaks a certain case: if you have a wrapped c++ function that
takes a bool, and you try to pass it an int, you get a
ArgumentError: Python argument types in
builtin_converters_ext.rewrap_const_reference_b
Hi,
Here is some thoughts on GSoC Boost.Python py3k support project.
First thing come into my mind is the build system. For Python 3, we
would have a separate build target, eg. having libboost_python.so
built for Python 2.x and libboost_python3.so for Python 3. This would
match the current situat
On Sat, Mar 14, 2009 at 9:29 PM, Stefan Seefeld wrote:
> David Abrahams wrote:
>>
>> On Mar 14, 2009, at 4:28 AM, Niall Douglas wrote:
>>
>>>
>>> Would it make sense if Dave acted as second as in "person we fall
>>> back upon if the primaries can't figure it out?"
>>
>> That would make plenty of s
A thought on this bytes vs. strings:
I am not sure if others do the same thing, but:
There are a number of places where the underlying library that we are
wrapping has a char* or a char[] that can be either a null terminated
string or an arbitrary bag of bytes depending on context. The fact that
Hello,
I have created a Python wrapper using a custom smart pointer that
is defined
in the following manner:
class_>("Event", init<>())
.def("f", &Event::f, &EventWrapper::default_f).
implicitely_convertible, Ptr>();
register_ptr_to_python>();
Now... when I subclass
this in Python
Matthew Scouten (TT) wrote:
I can work with whatever you come up with, but it might convenient if a
char* or char[] was treated as a bytes object and a std::string was
treated as a string. Thoughts?
A char* can never be fully treated as a bytes object. You must mean a
char* plus a size_t (or