a[3:]
actually creates new object in memory and python checks "equality" against b
.
You can see it that a[3:] is b
returns False
so they point to different objects(alternatively you could check ID's). Of course because there isn't any reference to that new object, it will be garbage collected after execution of that line.