empty classes as c structs?

Steven Bethard steven.bethard at gmail.com
Mon Feb 7 15:31:20 EST 2005


Carlos Ribeiro wrote:
> On Mon, 07 Feb 2005 11:50:53 -0700, Steven Bethard
> <steven.bethard at gmail.com> wrote:
> 
>>Michael Spencer wrote:
>>
>>>We could use __add__, instead for combining namespaces
>>
>>I don't think this is a good idea.  For the same reasons that dicts
>>don't have an __add__ (how should attributes with different values be
>>combined?), I don't think Bunch/Namespace should have an __add__.
> 
> For entirely unrelated reasons I did it for a bunch-like class of
> mine, and called it 'merge'. For this particular application it was a
> better name than update and append, but that's IMHO.

Did 'merge' have the same semantics as the 'update' being discussed? 
That is, did it modify the first 'bunch'?  Or did it create a new 
'bunch'?  To me, 'merge' sounds more like the second...

Steve



More information about the Python-list mailing list