Hi all,
I'm using boost::python to make bindings and now I got in trouble. I'm
trying to avoid Python deleting my C++ class before other classes but
I didn't find any clue on how to do this. Is there a way to tell boost
that my object should be the last one to be deleted? Thanks in
advance!
Regar
I looks at what it would take to write proper hash functions. These
classes have ridiculously complicated equality operators. I am going to
throw a type error and any users who don't like it can bite me.
Thanks guys.
-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
tho
I would like to have the __hash__ not exist. These objects are mutable
and should NOT be used as keys. Is there a way to hide it? If I have
them throw NotImplemented will python do something sensible with that?
Python raises a TypeError for unhashable things:
>>> [1,2,3].__hash__()
Traceback (
Hi
To solve my previous problem I'm trying implement a class witch store
the PyObject pointer.
using this solution:
http://www.boost.org/doc/libs/1_36_0/libs/python/doc/v2/faq.html#xref
then during the destructor of my wrapper class I want destroy the
PyObjects of my children with:
object_wrappe
I have a bunch of classes in c++ with operator== defined, and I exported
it as __eq__. They apparently inherited object's __hash__ . All was
well until my users started to put these objects in sets and use them as
dict keys. Objects that have the compare equal do not have the same
hash. This cause
2008/11/4 Alan Baljeu <[EMAIL PROTECTED]>
> Glad to read this here. I agree with you about the dislike thing. I can't
> stand auto_ptr, and if I had to give an object control over the life of
> another object I would generally choose a shared_ptr protocol. I mean, the
> object existed fine befo
Glad to read this here. I agree with you about the dislike thing. I can't
stand auto_ptr, and if I had to give an object control over the life of another
object I would generally choose a shared_ptr protocol. I mean, the object
existed fine before passing it in. Why can't it survive independ
2008/11/3 Stefan Seefeld <[EMAIL PROTECTED]>
> Alan Baljeu wrote:
>
>> I just read the tutorial page on pybindgen, but it doesn't talk about
>> reference types. 99% of my C++ code involves passing around things like
>> foo&, so this is significant to me. How is it done?
>>
>>
>
> If you need fin
On Tuesday 04 November 2008 01:18:47 Alan Baljeu wrote:
> void baz(foo &x);
>
> If I have a foo, I call baz with it, foo's contents may change but it's
> still the same object. I don't see an issue here, unless foo is a smart
> pointer type.
Sometimes, baz might store the reference (admittedly, t