Re: [C++-sig] strange behavior with respect to numeric and Boolean overloads

2009-03-17 Thread Hans Meine
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 ): >

Re: [C++-sig] strange behavior with respect to numeric and Boolean overloads

2009-03-16 Thread Roman Yakovenko
On Mon, Mar 16, 2009 at 8:30 PM, Matthew Scouten (TT) wrote: > I read the linked page, but this still feels like a bug to me. Or at least a > wart. Like I said, the order sensitivity I can live with, because that only > effects me. But the int vs bool problem is really obnoxious. C++ can tell an

Re: [C++-sig] strange behavior with respect to numeric and Boolean overloads

2009-03-16 Thread Ralf W. Grosse-Kunstleve
> I read the linked page, but this still feels like a bug to me. Or at least a > wart. I agree. Boost.Python 2 was written when the Python bool type still really was an int (Python 2.2). I'm not sure what it would take to retro-fit Boost.Python, but probably it is doable for a motivated volunt

Re: [C++-sig] strange behavior with respect to numeric and Boolean overloads

2009-03-16 Thread Matthew Scouten (TT)
I read the linked page, but this still feels like a bug to me. Or at least a wart. Like I said, the order sensitivity I can live with, because that only effects me. But the int vs bool problem is really obnoxious. C++ can tell an int from a bool, Python can tell an int from a bool, but library b

Re: [C++-sig] strange behavior with respect to numeric and Boolean overloads

2009-03-16 Thread Roman Yakovenko
2009/3/16 Matthew Scouten (TT) : > So here is some strange behavior I ran across with BP. A take a look at this > example code: > > > > busybox.cpp: > > > > #include "stdafx.h" > > > > std::string foo_int   (int    arg) { return std::string("foo(int) > Called"); } > > std::string foo_double(double

[C++-sig] strange behavior with respect to numeric and Boolean overloads

2009-03-16 Thread Matthew Scouten (TT)
So here is some strange behavior I ran across with BP. A take a look at this example code: busybox.cpp: #include "stdafx.h" std::string foo_int (intarg) { return std::string("foo(int) Called"); } std::string foo_double(double arg) { return std::string("foo(double) Called"); } s