Thus, as far as I know, dict is using set as its keys underlying data structure.
Hmm, no not really. The opposite way around is a closer analogy: in the implementation, a set is like using dicta dict with all null values. The dict came first in Python, setsand set did not appear until Python 2.2 (July 2000) - see PEP 218.
Also worth mentioning that dict.keys() is O(1) since Python 3, in. In Python 2 it's O(n) and you should use dict.viewkeys() for the setkeys "view" (set-like interface).
is
list(set)O(1)?
No, it's O(n) - just the same as the list comprehension.
And how is this implemented?
Sets support the iterator protocol.