Why python do not support element insertion in set? -


i want understand, internal design strategy that, can not allow element insertion in set. following link describe set implemented using dictionary,where every element of set key.

https://docs.python.org

so,why not supporting similar operation update in dictionary.

yes can, look:

>>> a=set() >>> a.add(1) >>> {1} >>> a.update([2,3,4,5]) >>> {1, 2, 3, 4, 5} >>>  

Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -