Message339437
| Author | serhiy.storchaka |
|---|---|
| Recipients | methane, rhettinger, serhiy.storchaka |
| Date | 2019-04-04.08:40:34 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1554367234.76.0.589006891219.issue36521@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
I think it is for historical reasons. Currently statements consisting of a constant expression are not compiled to a bytecode and do not add a value to co_consts. But when this optimization was not yet added, the first element of co_consts with a docstring was a docstring. So why add co_doc if the docstring is already available? This can be changed, but this is a breaking change, and what we will got instead? Function's __name__ is set from code object's co_name. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2019-04-04 08:40:34 | serhiy.storchaka | set | recipients: + serhiy.storchaka, rhettinger, methane |
| 2019-04-04 08:40:34 | serhiy.storchaka | set | messageid: <1554367234.76.0.589006891219.issue36521@roundup.psfhosted.org> |
| 2019-04-04 08:40:34 | serhiy.storchaka | link | issue36521 messages |
| 2019-04-04 08:40:34 | serhiy.storchaka | create | |