lists v. tuples
steve at REMOVE-THIS-cybersource.com.au
Mon Mar 17 14:22:48 CET 2008
On Mon, 17 Mar 2008 05:28:19 -0700, castironpi wrote:
> a tuple is a data
> structure such which cannot contain a refrence to itself.
>>> a =  # a list
>>> b = (a, None) # a tuple
>>> print b
([([...], None)], None)
>>> b is b
So, yes tuples can contain a reference to themselves, but only indirectly.
> Can a single expression refer to itself ever?
You can't refer to an object until it exists, so no.
More information about the Python-list