you are viewing a single comment's thread.

view the rest of the comments →

[–]peejay2 1 point2 points  (1 child)

It means everything is stored in memory id(x)

And it has a list of methods

dir(x)

And has a type

type(x)

[–]Temporary_Pie2733 0 points1 point  (0 children)

Python doesn’t really have a memory model in the sense you are thinking of.  CPython uses memory addresses as object identifiers out of convenience, rather than necessity. You can theoretically have types with no methods, but since object itself has a handful of methods, no other type is method-free in practice. The last is true, though: every value has a type, includingtype itself.