empty classes as c structs?

Carlos Ribeiro carribeiro at gmail.com
Mon Feb 7 15:22:06 EST 2005


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.

-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com



More information about the Python-list mailing list