You can simply write something like:
x = list()
and then hit Ctrl and click on list
. It will bring you to a file called builtins.py
, but lists and dictionaries are builtins, these are usually implemented by the interpreter. So as a result these have no Python implementation, it will show you something like:
class list(object):
"""
list() -> new empty list
list(iterable) -> new list initialized from iterable's items
"""
def append(self, p_object): # real signature unknown; restored from __doc__
""" L.append(object) -> None -- append object to end """
pass
def clear(self): # real signature unknown; restored from __doc__
""" L.clear() -> None -- remove all items from L """
pass
# ...
So it is actually more a "virtual" class definition that is generated based on the documentation. The list
object is not implemented in Python itself: it is an object implemented in the Python interpreter. This makes sense since it is impossible to implement a list (with fast random access) without having something like a list/array.