[C++-sig] Re: Re: Boost.Python v2: object facilities updated

Joel de Guzman djowel at gmx.co.uk
Wed Jun 19 21:26:13 CEST 2002


David Abrahams wrote:

>>What is the reason for not creating a Py_None object with the default
>>constructor?
>>
>
>No direct analogue in Python. But that's not neccessarily a good reason.
>Wouldn't it be better to have a None object, though?
>
>    object x = None;
>
>>With all its extra functionality now it can be used for much
>>more than just capturing return values. It is occasionally useful to
>>
>declare
>
>>an object and defer its actual assignment.
>>
>
>Sure. I'll add the default constructor if there's a good reason to, but I
>don't see one yet.
>
Is there a reason why not? I mean, will there be problems if a default 
constructor
that creates a None object was introduced? Aesthetically, I kinda agree with
Dave Hawkes. Right off the bat, it might be useful when, say, stuffing 
preallocated
vector<object>, for instance. But I am not sure if that would be useful 
nor practical.

2c worth ;-) Pardon me if this does not make sense.

--Joel












More information about the Cplusplus-sig mailing list