Q:

Why "=" is not possible for the "add" function in "set" object in python?

in python, add is used to add items to a set object:
set_object = {'apple', 'orange'}
set_object.add('pear')

However, new_object = set_object.add('pear') is not equivalent to set_object.add('pear').  
So why is that, and is there an equivalent way to assign the new_object to a variable? What I should do if I do not want to modify the original set_object?
This also does not work 
new_object = set_object + {'pear'}

Currently, it seems that I have to do:
set_object = {'apple', 'orange'}
set_object.add('pear')
new_object = set_object
set_object = {'apple', 'orange'}

Is there a more efficient way?

A:

You can use union function  or '|' operator to append new set to the existing one.  
set_object = {'apple', 'orange'}
new_object = set_object | {'pear'}

or 
set_object = {'apple', 'orange'}
new_object = set_object.union({'pear'})

