[issue38787] PEP 573: Module State Access from C Extension Methods

2020-11-25 Thread STINNER Victor


STINNER Victor  added the comment:

FYI Cython doesn't support this PEP yet: 
https://github.com/cython/cython/issues/3917

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-10-20 Thread Petr Viktorin


Petr Viktorin  added the comment:

Thanks Victor, Hai Shi, Pablo, Stefan, Dong-hee Na and Mariatta for reviews!

I did not put all the details in the documentation because there are still 
feature gaps. So, a full write-up is now in the informational PEP 630.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-09-04 Thread miss-islington


miss-islington  added the comment:


New changeset fbb9ee0a903fb9b7b4b807f85aed1de754da09e6 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-38787: Clarify docs for PyType_GetModule and warn against common 
mistake (GH-20215) (GH-21984)
https://github.com/python/cpython/commit/fbb9ee0a903fb9b7b4b807f85aed1de754da09e6


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-08-27 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset d9a966ae08258da2ce2a432c943d8194760f09c4 by Petr Viktorin in 
branch 'master':
bpo-38787: Clarify docs for PyType_GetModule and warn against common mistake 
(GH-20215)
https://github.com/python/cpython/commit/d9a966ae08258da2ce2a432c943d8194760f09c4


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-08-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21093
pull_request: https://github.com/python/cpython/pull/21984

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-23 Thread hai shi


Change by hai shi :


--
pull_requests: +19609
pull_request: https://github.com/python/cpython/pull/20344

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-19 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +19510
pull_request: https://github.com/python/cpython/pull/20215

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-13 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 97e1568325e4d8eff2fc80eeb174b3f3e5d1c350 by Victor Stinner in 
branch 'master':
bpo-38787: Fix Argument Clinic defining_class_converter (GH-20074)
https://github.com/python/cpython/commit/97e1568325e4d8eff2fc80eeb174b3f3e5d1c350


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-13 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19380
pull_request: https://github.com/python/cpython/pull/20074

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-13 Thread hai shi


hai shi  added the comment:

> I guess I'll need to clarify the documentation here.
> Call `PyType_GetModule` on the *defining class*, not on type(self).

+1, I didn't notice this detail until I got the error.

> The associated module is not inherited; each class in the MRO can be > 
> defined in a different module.

Thanks, pep have enough info, I need spend sometime to make sure I understand 
it clearly, Lol~.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-13 Thread Petr Viktorin


Petr Viktorin  added the comment:

I guess I'll need to clarify the documentation here.
Call `PyType_GetModule` on the *defining class*, not on type(self). See the PEP 
for details.
The associated module is not inherited; each class in the MRO can be defined in 
a different module.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-12 Thread hai shi


hai shi  added the comment:

In PR19982, petr have mentioned that `PyType_GetModule` can not worked if the 
type is the subtype.

I try to use pep573 in functools, I get the error info from testcases:
==
ERROR: test_arg_combinations (test.test_functools.TestPartialCSubclass)
--
Traceback (most recent call last):
  File "/temp/shihai/cpython/Lib/test/test_functools.py", line 109, in 
test_arg_combinations
p = self.partial(capture)
TypeError: PyType_GetModule: Type 'CPartialSubclass' has no associated module

==
ERROR: test_attributes (test.test_functools.TestPartialCSubclass)
--
Traceback (most recent call last):
  File "/temp/shihai/cpython/Lib/test/test_functools.py", line 71, in 
test_attributes
p = self.partial(capture, 1, 2, a=10, b=20)
TypeError: PyType_GetModule: Type 'CPartialSubclass' has no associated module

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-12 Thread miss-islington


miss-islington  added the comment:


New changeset 4c9ea093cd752a6687864674d34250653653f743 by scoder in branch 
'master':
bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks (GH-20024)
https://github.com/python/cpython/commit/4c9ea093cd752a6687864674d34250653653f743


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-10 Thread Stefan Behnel


Change by Stefan Behnel :


--
pull_requests: +19334
pull_request: https://github.com/python/cpython/pull/20024

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-10 Thread STINNER Victor


STINNER Victor  added the comment:

The posix/nt and _abc modules now use the PEP 573 APIs:

* posix/nt: commit 1c2fa781560608aa4be50c748d4b3f403cfa5035 (bpo-40549)
* _abc: commit 77c614624b6bf2145bef69830d0f499d8b55ec0c (bpo-40566)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-10 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-40574: segfault causing regression from PEP 573 implementation 
(PyQt5).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c068b53a0ca6ebf740d98e422569d2f705e54f93 by Hai Shi in branch 
'master':
bpo-38787: Update structures.rst docs (PEP 573) (GH-19980)
https://github.com/python/cpython/commit/c068b53a0ca6ebf740d98e422569d2f705e54f93


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-07 Thread hai shi


Change by hai shi :


--
pull_requests: +19296
pull_request: https://github.com/python/cpython/pull/19980

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e1becf46b4e3ba6d7d32ebf4bbd3e0804766a423 by Petr Viktorin in 
branch 'master':
bpo-38787: C API for module state access from extension methods (PEP 573) 
(GH-19936)
https://github.com/python/cpython/commit/e1becf46b4e3ba6d7d32ebf4bbd3e0804766a423


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-06 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-40137: TODO list when PEP 573 "Module State Access from C 
Extension Methods" will be implemented.

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-05 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +19251
pull_request: https://github.com/python/cpython/pull/19936

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-04-29 Thread Petr Viktorin


Petr Viktorin  added the comment:

I'm working on the implementation as my time allows, here: 
https://github.com/encukou/cpython/pull/3 .

Would it help to create a proper PR for CPython now? That would mean I could no 
longer do rebases/force-pushes, so the commits would be less readable. But 
happy to do it if it would help you.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-04-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The PEP is listed as accepted, with you as the BDFL-delegate, but it lacks a 
link to the public acceptance message (usually on pydev list).

The PR was not rejected by a core dev but was closed without explanation by the 
author on the same day the last commits were added.  Perhaps OP just gave up 
getting tests to pass.  But they disappear on closes.  

However, the contribution had been made under the CLA and you or Petr or any 
other core dev should be able to download it to a local branch, try to whip it 
into shape, and make a new PR before beta 1, in about a month.  Or start from 
scratch.

I cannot test downloading at the moment.  Apparently, OP's fork branch has been 
altered, so that merely reopening is not an option.  The OP used force-pushes 
rather than update merges, and this often creates problems.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-04-28 Thread Stefan Behnel


Stefan Behnel  added the comment:

What can we do to move this forward? I see that the original PR was closed in 
January. Is there or will there be a new one? Can I help with anything?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2019-11-13 Thread Marcel Plch


Change by Marcel Plch :


--
keywords: +patch
pull_requests: +16655
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17145

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38787] PEP 573: Module State Access from C Extension Methods

2019-11-13 Thread Marcel Plch


New submission from Marcel Plch :

Currently, there is not way to access per-module state from the methods of 
types defined in extension modules.

This PEP provides a fix to this issue.

PEP 573 - https://www.python.org/dev/peps/pep-0573/

Reference implementation - 
https://github.com/Dormouse759/cpython/tree/pep-c-rebase_newer

--
components: Extension Modules
messages: 356533
nosy: Dormouse759, ncoghlan, petr.viktorin, scoder, terry.reedy
priority: normal
severity: normal
status: open
title: PEP 573: Module State Access from C Extension Methods
type: enhancement
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com