Emanuele D'Arrigo wrote: > So, it appears that in the first case a and b are names to the same > string object, while in the second case they are to two separate > objects. Why? What's so special about the forward slash that cause the > two "/a" strings to create two separate objects? Is this an > implementation-specific issue?
Python special cases certain objects like str with one element or small ints from -10 to +256 for performance reasons. It's version and implementation specific and may change in the future. Do NOT rely on it! Christian -- http://mail.python.org/mailman/listinfo/python-list