[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-09-20 Thread Stefan Behnel
Stefan Behnel added the comment: Closing again since GH-21528 has been merged in issue 41295. -- status: open -> closed ___ Python tracker ___

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-18 Thread Stefan Behnel
Stefan Behnel added the comment: I pushed PR 21528 with a new proposal. See issue 41295. -- ___ Python tracker ___ ___

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-18 Thread Stefan Behnel
Stefan Behnel added the comment: > intermediate base type "object" in the hierarchy Sorry, I meant an intermediate base type "B", which inherits its setattr from "object". -- ___ Python tracker

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-18 Thread Stefan Behnel
Stefan Behnel added the comment: The problem in the test added in PR 21473 is that there is an intermediate base type "object" in the hierarchy: class A(type): def __setattr__(cls, key, value): type.__setattr__(cls, key, value) class B: pass class

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-14 Thread Guido van Rossum
Guido van Rossum added the comment: @Stefan Do you agree that the fix proposed in PR 21473 needs to be made? -- ___ Python tracker ___

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-14 Thread Guido van Rossum
Guido van Rossum added the comment: Reopening because there appears to be a problem with the fix (see PR 21473). -- status: closed -> open ___ Python tracker ___

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-14 Thread David Caro
Change by David Caro : -- nosy: +David Caro nosy_count: 5.0 -> 6.0 pull_requests: +20618 pull_request: https://github.com/python/cpython/pull/21473 ___ Python tracker ___

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-05 Thread Guido van Rossum
Guido van Rossum added the comment: You're welcome. Hope this helps Cpython users. -- ___ Python tracker ___ ___ Python-bugs-list

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-05 Thread Stefan Behnel
Stefan Behnel added the comment: Fixed in 3.8+. Closing. Thanks for the feedback. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-05 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 8912c182455de83e27d5c120639ec91b18247913 by scoder in branch '3.8': bpo-39960: Allow heap types in the "Carlo Verre" hack check that override "tp_setattro()" (GH-21092) (GH-21339)

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-05 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +20487 pull_request: https://github.com/python/cpython/pull/21339 ___ Python tracker ___

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-02 Thread miss-islington
miss-islington added the comment: New changeset bfec674254ea22ef9c0c335587eb65683f4145c7 by Miss Islington (bot) in branch '3.9': bpo-39960: Allow heap types in the "Carlo Verre" hack check that override "tp_setattro()" (GH-21092)

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-02 Thread Guido van Rossum
Guido van Rossum added the comment: Stefan can you do the 3.8 backport? -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-02 Thread miss-islington
miss-islington added the comment: New changeset 148f32913573c29250dfb3f0d079eb8847633621 by scoder in branch 'master': bpo-39960: Allow heap types in the "Carlo Verre" hack check that override "tp_setattro()" (GH-21092)

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-02 Thread miss-islington
Change by miss-islington : -- pull_requests: +20435 pull_request: https://github.com/python/cpython/pull/21288 ___ Python tracker ___

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-02 Thread Stefan Behnel
Stefan Behnel added the comment: I think we missed the train for fixing 3.7 (which was questionable anyway), but I added a test, so it's ready for merging into 3.8+ (minus merge conflicts for the test in 3.8, probably). -- ___ Python tracker

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-07-02 Thread Stefan Behnel
Change by Stefan Behnel : -- versions: -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-23 Thread Stefan Behnel
Change by Stefan Behnel : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-23 Thread Stefan Behnel
Stefan Behnel added the comment: I chose to go through the MRO, which takes multiple inheritance into account. -- stage: patch review -> ___ Python tracker ___

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-23 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +20258 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21092 ___ Python tracker ___

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-23 Thread Petr Viktorin
Petr Viktorin added the comment: > do we still only support single inheritance at the C level? Not any more. Heap types may have multiple bases, and they can be created at the C level (since Python 3.2, PEP 384). > So, I think we should do something like walking up the hierarchy to find

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-21 Thread Guido van Rossum
Guido van Rossum added the comment: That sounds like the right thing to do. You should be able to recognize pure Python __setattr__ implementations by the presence of slot_tp_setattro in the tp_setattro slot. (Likewise for __delattr__.) It's been really long since I looked at this -- do we

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-21 Thread Stefan Behnel
Stefan Behnel added the comment: This SO answer by Martijn Pieters explains the background: https://stackoverflow.com/a/44854477 and links to the original python-dev discussion: https://mail.python.org/pipermail/python-dev/2003-April/034535.html The current implementation checks that the

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-20 Thread Guido van Rossum
Guido van Rossum added the comment: See also test_carloverre() in test_descr.py. I don't recall exactly what this was about, but that test is definitely relevant. -- ___ Python tracker

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-20 Thread Stefan Behnel
Stefan Behnel added the comment: I ran into this, too. I agree that the "hackcheck" loop on heap types is probably wrong. https://github.com/python/cpython/blob/04fc4f2a46b2fd083639deb872c3a3037fdb47d6/Objects/typeobject.c#L5947-L5977 It was written at a time (Py2.3?) when (practically)

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-03-13 Thread Matthias Braun
New submission from Matthias Braun : This is about an extension type created via `PyType_FromSpec` that overrides `tp_setattro` (minimal example attached). In this case cpython does not let me grab and use the `__setattr__` function "manually". Example: ``` >>> import demo >>> mytype_setattr