Message88556
On Fri, May 29, 2009 at 3:45 PM, Martin v. Löwis <report@bugs.python.org> wrote:
> 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.
The fact that it returns a new object every time seems like an
implementation detail, and one that users find confusing (I know I
once filed a bug about it).
One problem I recognize is that the proposed patch would presumably
create an asymmetry between "x".join is "x".join and "x = 'x'; x.join
is x.join" where the former would evaluate to True and the latter to
False. That seems surmountable, though. |
|
Date |
User |
Action |
Args |
2009-05-30 00:04:43 | collinwinter | set | recipients:
+ collinwinter, loewis, rhettinger, terry.reedy, alex |
2009-05-30 00:04:41 | collinwinter | link | issue6133 messages |
2009-05-30 00:04:39 | collinwinter | create | |
|