Passing a callable object to Thread
Jeff Schwab
jeff at schwabcenter.com
Mon Feb 18 19:29:48 EST 2008
Paul Rubin wrote:
> Jeff Schwab <jeff at schwabcenter.com> 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.
Thanks for clarifying.
More information about the Python-list
mailing list