[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-27 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- versions: +Python 3.9 -Python 3.10 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-27 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > Can we close this issue? Or is there a remaining task? 3.9 is still affected; we should fix those types first. -- ___ Python tracker

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: Can we close this issue? Or is there a remaining task? -- ___ Python tracker ___ ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: In Python 3.11, 41 types are declared explicitly with the Py_TPFLAGS_DISALLOW_INSTANTIATION flag: * _curses_panel.panel * _dbm.dbm * _gdbm.gdbm * _hashlib.HASH * _hashlib.HASHXOF * _hashlib.HMAC * _md5.md5 * _multibytecodec.MultibyteCodec * _sha1.sha1 *

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-06-24 Thread STINNER Victor
STINNER Victor added the comment: New changeset 733587011dbb47c2e461188f0574e1cc5288062a by Miss Islington (bot) in branch '3.10': bpo-43916: Use test.support.check_disallow_instantiation() in test_tcl (GH-26412) (GH-26888)

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-06-24 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +25465 pull_request: https://github.com/python/cpython/pull/26888 ___ Python tracker

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-06-20 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: FYI, bpo-44087 added the Py_TPFLAGS_DISALLOW_INSTANTIATION flag to sqlite3.Statement. (Side note: I find the issue title a little bit confusing.) -- ___ Python tracker

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset e90e0422182f4ca7faefd19c629f84aebb34e2ee by Erlend Egeberg Aasland in branch 'main': bpo-43916: Use test.support.check_disallow_instantiation() in test_tcl (GH-26412)

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Please, check also the discusion happening here: https://mail.python.org/archives/list/python-committ...@python.org/thread/FHFI7QKWNHAVWVFTCHJGTYD3ZFVEUXDD/ -- ___ Python tracker

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-27 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +25006 pull_request: https://github.com/python/cpython/pull/26412 ___ Python tracker ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-27 Thread STINNER Victor
STINNER Victor added the comment: Erlend added test.support.check_disallow_instantiation() function in bpo-43988 to write tests for immutable types. -- ___ Python tracker

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset c2931d31f8ba7cf10044de276018c713ffc73592 by Pablo Galindo in branch 'master': bpo-43916: Move the _PyStructSequence_InitType function to the internal API (GH-25854)

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-03 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +24538 pull_request: https://github.com/python/cpython/pull/25854 ___ Python tracker ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-01 Thread Christian Heimes
Christian Heimes added the comment: New changeset ddbef71a2c166a5d5dd168e26493973053a953d6 by Christian Heimes in branch 'master': bpo-43916: Rewrite new hashlib tests, fix typo (GH-25791) https://github.com/python/cpython/commit/ddbef71a2c166a5d5dd168e26493973053a953d6 --

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-01 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I have transformed https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403 into a wiki. Tell me if you need some alterations of something is missing. -- ___ Python tracker

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-01 Thread Christian Heimes
Change by Christian Heimes : -- pull_requests: +24480 pull_request: https://github.com/python/cpython/pull/25791 ___ Python tracker ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-01 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > See https://meta.discourse.org/t/what-is-a-wiki-post/30801 Gotcha, will try to do that as soon as possible -- ___ Python tracker

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: > Not sure what do you have in mind for the wiki See https://meta.discourse.org/t/what-is-a-wiki-post/30801 -- ___ Python tracker

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 558df9010915c8fe94f4d7f842e7c5aabbb06b14 by Pablo Galindo in branch 'master': bpo-43916: Export the _PyStructSequence_InitType to fix build errors in the curses module (GH-25768)

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The build errors were in the CI, but because Python doesn't complain if it cannot build a module, then we never catched this. I have opened https://github.com/python/cpython/pull/25768 to fix it to unblock the release, since the curses module is

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +24461 pull_request: https://github.com/python/cpython/pull/25768 ___ Python tracker ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The problem is that the curses module is using a function that requires to be built in the core: #ifdef Py_BUILD_CORE extern int _PyStructSequence_InitType( PyTypeObject *type, PyStructSequence_Desc *desc, unsigned long tp_flags); #endif

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Something is wrong after commit 3bb09947ec4837de75532e21dd4bd25db0a1f1b7. When building Python I am getting: *** WARNING: renaming "_curses" since importing it failed:

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > * _ast.AST: use {Py_tp_new, PyType_GenericNew} and {Py_tp_init, > ast_type_init} slots. What happens if tp_new is called without calling > tp_init? I think this is fine since ast_type_init doesn't initialize any C fields and only mutates the

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > If one of the admins could make that post into a wiki post, it would be open > for editing, making it easier to fill the holes in the lists. Not sure what do you have in mind for the wiki, but the easiest is to open some GitHub issue somewhere or

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: > These lists are not complete, for example select.kevent was not listed > whereas it has a bug. If one of the admins could make that post into a wiki post, it would be open for editing, making it easier to fill the holes in the lists. --

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: I checked " Types converted pre Python 3.9" and "Types converted in Python 3.9" of: https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403 (I didn't check "Types converted in Python 3.10" yet.) These lists are not complete, for

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: * _tkinter.Tcl_Obj * _tkinter.tkapp * _tkinter.tktimertoken Oops, sorry: in Python 3.9, tp_new is set to NULL after these heap types are created. There is no bug for these 3 types. -- ___ Python tracker

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: Status in Python 3.9. 5 types allow instantiation whereas they must not: BUG!!! * _tkinter.Tcl_Obj * _tkinter.tkapp * _tkinter.tktimertoken * zlib.Compress * zlib.Decompress Example of bug: $ python3.9 Python 3.9.4 >>> import zlib >>>

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: > bpo-43916: _md5.md5 uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25753) With this change, all tests listed in this issue should be fixed. But I didn't check the whole list of https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 665c7746fca180266b121183c2d5136c547006e0 by Victor Stinner in branch 'master': bpo-43916: _md5.md5 uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25753) https://github.com/python/cpython/commit/665c7746fca180266b121183c2d5136c547006e0 --

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: Yes, the sqlite3 types are fine. I don't know why I included them in my earlier post. I cleared the tp_new markings for the sqlite3 types on the Discourse post, since I can edit my posts over there, contrary to here on bpo :) --

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 7dcf0f6db38b7ab6918608542d3a0c6da0a286af by Victor Stinner in branch 'master': bpo-43916: select.devpoll uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25751) https://github.com/python/cpython/commit/7dcf0f6db38b7ab6918608542d3a0c6da0a286af

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: It seems like _sqlite3 heap types support regular instantiation and so that no change is needed. * sqlite3.Cache {Py_tp_new, PyType_GenericNew}, * sqlite3.Connection {Py_tp_new, PyType_GenericNew}, {Py_tp_init, pysqlite_connection_init}, *

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: * _md5.md5 * _sha1.sha1 * _sha256.sha224 * _sha256.sha256 * _sha512.sha384 * _sha512.sha512 I created PR 25753. -- ___ Python tracker ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +24443 pull_request: https://github.com/python/cpython/pull/25753 ___ Python tracker ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: According to msg391924, more types should use Py_TPFLAGS_DISALLOW_INSTANTIATION: * _md5.md5 * _sha1.sha1 * _sha256.sha224 * _sha256.sha256 * _sha512.sha384 * _sha512.sha512 * select.devpoll: I created PR 25751 * select.kevent: it implements a working tp_new

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +24441 pull_request: https://github.com/python/cpython/pull/25751 ___ Python tracker ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: I remove the release blocker priority of this issue, since the main issue has been fixed. -- priority: release blocker -> ___ Python tracker

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: Currently, 33 types explicitly set the Py_TPFLAGS_DISALLOW_INSTANTIATION flag: * PyStdPrinter_Type * _curses.ncurses_version type * _curses_panel.panel * _dbm.dbm * _gdbm.gdbm * _hashlib.HASH * _hashlib.HASHXOF * _hashlib.HMAC * _multibytecodec.MultibyteCodec

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: Pablo & Serhiy, can we close this issue now? -- ___ Python tracker ___ ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 9746cda705decebc0ba572d95612796afd06dcd4 by Erlend Egeberg Aasland in branch 'master': bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748)

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 387397f8a4244c983f4568c16a28842e3268fe5d by Erlend Egeberg Aasland in branch 'master': bpo-43916: select.poll uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25750) https://github.com/python/cpython/commit/387397f8a4244c983f4568c16a28842e3268fe5d

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- pull_requests: +24439 pull_request: https://github.com/python/cpython/pull/25750 ___ Python tracker ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 4908fae3d57f68694cf006e89fd7761f45003447 by Victor Stinner in branch 'master': bpo-43916: PyStdPrinter_Type uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25749) https://github.com/python/cpython/commit/4908fae3d57f68694cf006e89fd7761f45003447

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +24438 pull_request: https://github.com/python/cpython/pull/25749 ___ Python tracker ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- pull_requests: +24437 pull_request: https://github.com/python/cpython/pull/25748 ___ Python tracker ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 0cad068ec174bbe33fb80460da56eb413f3b9359 by Victor Stinner in branch 'master': bpo-43916: Remove _disabled_new() function (GH-25745) https://github.com/python/cpython/commit/0cad068ec174bbe33fb80460da56eb413f3b9359 --

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +24434 pull_request: https://github.com/python/cpython/pull/25745 ___ Python tracker ___

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
Change by STINNER Victor : -- components: +C API ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-04-30 Thread STINNER Victor
Change by STINNER Victor : -- title: Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag -> Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag