This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients alex, collinwinter, loewis, rhettinger, terry.reedy
Date 2009-05-29.22:45:36
SpamBayes Score 0.04862709
Marked as misclassified No
Message-id <4A20658F.30305@v.loewis.de>
In-reply-to <1243628701.02.0.238860963294.issue6133@psf.upfronthosting.co.za>
Content
Terry J. Reedy wrote:
> Terry J. Reedy <tjreedy@udel.edu> added the comment:
> 
> Martin, I agree that we would have to think carefully about all
> attributes of all constants loaded by LOAD_CONST, and about
> special-casing marshal, but given that "'str' object attribute 'join' is
> read-only", how is ''.join not a constant?  

py> s = ""
py> s.join is s.join
False

Every time you read it, you get a new object. Not what I would call a
constant. If you don't see how this matters, try

def foo():
  return "".join

print foo() is foo()

with and without your patch.
History
Date User Action Args
2009-05-29 22:45:39loewissetrecipients: + loewis, collinwinter, rhettinger, terry.reedy, alex
2009-05-29 22:45:37loewislinkissue6133 messages
2009-05-29 22:45:36loewiscreate