[C++-sig] object().attr_allow_null()

David Abrahams david.abrahams at rcn.com
Mon Jul 22 19:08:14 CEST 2002


From: "Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com>

> I very much like this idea. But let me ask anyway:
> If is() were a free function, what signature(s) would it have?
> Just one overload: is(object a0, object a1)?

    is(object const&, object const&); // for efficiency

No point in checking the object identity of non-objects ;-)
Hmmn, I take it back; you ought to be able to pass, e.g. NumPyArray* here.
Anyway, the single signature above will do for the time being.

> > In the meantime, if you're worried about cycles:
> > 
> >     if (getinitargs.ptr() != Py_None)
> 
> From src/object/pickle_support.cpp:
> 
> object none;
> ...
> if (getinitargs.ptr() != none.ptr())
> 
> Is your None above the same is my none here?

Yeah, 'xcept it would be provided by the library.

-Dave







More information about the Cplusplus-sig mailing list