➜

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.

作者 vstinner
收信人 Guido.van.Rossum, Mark.Shannon, christian.heimes, corona10, erlendaasland, gvanrossum, pablogsal, serhiy.storchaka, shihai1991, shreyanavigyan, vstinner
日期 2021-04-29.14:27:39
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1619706459.75.0.498618370957.issue43908@roundup.psfhosted.org>
In-reply-to
内容
> https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403

In the past, I used _random.Random for manual tests to compare static type and heap types, check which one is mutable.

C type _random.Random is inherited by Python type random.Random which is mutable. Since _random.Random is not directly seen by developers, I don't think that it's worth it to make it immutable.

For the other types, I would not say that they are "built-in types" or that it would be really bad to modify them. I would say that for the other types, the "We are consenting adults" rule stands. You can hack a type for a very specific need, but in this case you are on your own.

For example, people love to hack AST. Maybe the fact that ast.AST became mutable in Python 3.9 will unlock some crazy hack?
历史
日期 用户 动作 参数
2021-04-29 14:27:39vstinner修改recipients: + vstinner, gvanrossum, christian.heimes, Mark.Shannon, serhiy.storchaka, Guido.van.Rossum, corona10, pablogsal, shihai1991, erlendaasland, shreyanavigyan
2021-04-29 14:27:39vstinner修改messageid: <1619706459.75.0.498618370957.issue43908@roundup.psfhosted.org>
2021-04-29 14:27:39vstinner链接issue43908 messages
2021-04-29 14:27:39vstinner创建