INADA Naoki added the comment: See set_update_internal(). https://github.com/python/cpython/blob/master/Objects/setobject.c#L969-L1016
This happens only when iterable is set or dict. >>> import sys >>> sys.getsizeof(set(range(10))) 736 >>> sys.getsizeof(set(set(range(10)))) 1248 >>> sys.getsizeof(set(dict.fromkeys(range(10)))) 1248 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29949> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com