On 1 Aug 2005 05:12:47 -0000, Gurpreet Sachdeva
<[EMAIL PROTECTED]> wrote:
>  Hi,
>  
>  Is there any provision in python which allows me to make my own operators?
>  
>  My problem is that I need to combine two dictonaries with their keys and I
> don't want to use any of the existing operators like '+','-','*'.
>  So is there a way I can make '**' or '~' as my operators to add two
> dictonaries? If not which all operators can I overoad?
>  
>  Thanks,
>  Garry

Why do you need to add operators for this? Why not use the
dictionary's update method? it also has the benefit of being much
clearer.

# Get our two dictionaries
d1 = foo()
d2 = bar()
# And merge them into a third
d3 = {}
d3.update(d1)
d3.update(d2)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to