➜

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
收信人 Mark.Shannon, corona10, erlendaasland, gvanrossum, shihai1991, vstinner
日期 2021-04-22.12:41:17
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1619095277.87.0.757130117807.issue43908@roundup.psfhosted.org>
In-reply-to
内容
Guido:
> Sorry for making this a deferred blocker. I recall that we had a brief discussion somewhere about an accidental change to the array.array type -- this is now a heap type (Py_TPFLAGS_HEAPTYPE is set), and as a consequence it is no longer immutable.

*Many* static types have been converted to heap types in Python 3.9 and Python 3.10. Is there a rule to decide which types should be mutable or not?

All types implemented in Python are mutable, unless the very few which use slots.

By the way, some cases can be inherited or not. Do we care about that?

Example:

$ python3
Python 3.9.2 (default, Feb 20 2021, 00:00:00) 
>>> def f(): pass
... 
>>> class MyFuncType(type(f)): pass
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: type 'function' is not an acceptable base type
历史
日期 用户 动作 参数
2021-04-22 12:41:17vstinner修改recipients: + vstinner, gvanrossum, Mark.Shannon, corona10, shihai1991, erlendaasland
2021-04-22 12:41:17vstinner修改messageid: <1619095277.87.0.757130117807.issue43908@roundup.psfhosted.org>
2021-04-22 12:41:17vstinner链接issue43908 messages
2021-04-22 12:41:17vstinner创建