Message 258542 - Python tracker (original) (raw)
Message258542
| Author | serhiy.storchaka |
|---|---|
| Recipients | benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, rhettinger, serhiy.storchaka, vstinner, yselivanov |
| Date | 2016-01-18.20:09:48 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | 1453147788.86.0.284579420871.issue26148@psf.upfronthosting.co.za |
| In-reply-to |
| Content |
|---|
| Usually string literals are interned. But not if they are a part of constant tuple. >>> def abc(): pass ... >>> x = 'abc' >>> x is abc.__name__ True >>> x = ('abc',) >>> x[0] is abc.__name__ False This makes effect on namedtuples (). May make effect on __slots__ or other uses of constant tuples since searching a value in a tuple when values are not identical is a little slower that when they are identical. |
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2016-01-18 20:09:48 | serhiy.storchaka | set | recipients: + serhiy.storchaka, brett.cannon, georg.brandl, rhettinger, ncoghlan, vstinner, benjamin.peterson, yselivanov |
| 2016-01-18 20:09:48 | serhiy.storchaka | set | messageid: 1453147788.86.0.284579420871.issue26148@psf.upfronthosting.co.za |
| 2016-01-18 20:09:48 | serhiy.storchaka | link | issue26148 messages |
| 2016-01-18 20:09:48 | serhiy.storchaka | create |