Bossett
itโ€™s probably weird that python has an โ€˜isโ€™ operator that seems to just do a pointer comparison like why leak that abstraction in particular when youโ€™re working so hard not to expose the fact that pointers exist
2 4
goeo like the
i think the "real" use case is with booleans where you're ensuring you're comparing against True and not something truthy, without being like (type(x) == bool and x)
1
Marsh Ray
I remember the time I tried to construct a custom thing by adding some methods onto an instance of Object and it was like โ€œnope canโ€™t do that, itโ€™s not *that* kind of objectโ€.
Toni Alatalo ๐Ÿ‡ซ๐Ÿ‡ฎ๐Ÿ’š
It's the memory address of the native data structure for your Python object. In CPython (the normal one from python.org) every object (e.g. number) is a C struct, type PyObject. >>> id("foo") 4381153456 id() gives the address. 'is' checks that for identity checks, i.e. if the objs are the same.
5