Jeff Schwab <[EMAIL PROTECTED]> writes: > I think you're a little confused about the meaning of "numeric > literal." (5+1) is not a numeric literal. Neither is > (999999999999999999999999999999+1). > > The flyweight pattern does not guarantee that all equivalent instances > of an object type will be identical.
I don't think there's any Python language rule that says multiple uses of the same numeric literal turn into the same object. It's just an optimization (constant folding) that the CPython implementation happens to perform. Other implementations might not do it, or CPython might do it differently in some future version. -- http://mail.python.org/mailman/listinfo/python-list