[Python-Dev] Make extension module initialisation more like Python module initialisation

2012-11-08 Thread Stefan Behnel
Hi, I suspect that this will be put into a proper PEP at some point, but I'd like to bring this up for discussion first. This came out of issues 13429 and 16392. http://bugs.python.org/issue13429 http://bugs.python.org/issue16392 Stefan The problem === Python modules and extension

Re: [Python-Dev] Make extension module initialisation more like Python module initialisation

2012-11-08 Thread Stefan Behnel
M.-A. Lemburg, 08.11.2012 14:01: On 08.11.2012 13:47, Stefan Behnel wrote: I suspect that this will be put into a proper PEP at some point, but I'd like to bring this up for discussion first. This came out of issues 13429 and 16392. http://bugs.python.org/issue13429

Re: [Python-Dev] Make extension module initialisation more like Python module initialisation

2012-11-08 Thread Stefan Behnel
Stefan Behnel, 08.11.2012 14:20: M.-A. Lemburg, 08.11.2012 14:01: On 08.11.2012 13:47, Stefan Behnel wrote: I suspect that this will be put into a proper PEP at some point, but I'd like to bring this up for discussion first. This came out of issues 13429 and 16392.

[Python-Dev] Update - Re: Make extension module initialisation more like Python module initialisation

2012-11-08 Thread Stefan Behnel
Hi, here's an updated proposal, adopting Marc-Andre's improvement that uses a new field in the PyModuleDef struct to register the callback. Note that this change no longer keeps up binary compatibility, which may or may not be acceptable for Python 3.4. Stefan The problem === Python

Re: [Python-Dev] Make extension module initialisation more like Python module initialisation

2012-11-08 Thread Brett Cannon
On Thu, Nov 8, 2012 at 7:47 AM, Stefan Behnel stefan...@behnel.de wrote: Hi, I suspect that this will be put into a proper PEP at some point, but I'd like to bring this up for discussion first. This came out of issues 13429 and 16392. http://bugs.python.org/issue13429

Re: [Python-Dev] Make extension module initialisation more like Python module initialisation

2012-11-08 Thread Stefan Behnel
Hi Brett, thanks for the feedback. Brett Cannon, 08.11.2012 15:41: On Thu, Nov 8, 2012 at 7:47 AM, Stefan Behnel wrote: I propose to split the extension module initialisation into two steps in Python 3.4, in a backwards compatible way. Step 1: The current module init function can be reduced

Re: [Python-Dev] Make extension module initialisation more like Python module initialisation

2012-11-08 Thread Brett Cannon
On Thu, Nov 8, 2012 at 10:00 AM, Stefan Behnel stefan...@behnel.de wrote: Hi Brett, thanks for the feedback. Brett Cannon, 08.11.2012 15:41: On Thu, Nov 8, 2012 at 7:47 AM, Stefan Behnel wrote: I propose to split the extension module initialisation into two steps in Python 3.4, in a

Re: [Python-Dev] Make extension module initialisation more like Python module initialisation

2012-11-08 Thread Stefan Behnel
Brett Cannon, 08.11.2012 16:06: On Thu, Nov 8, 2012 at 10:00 AM, Stefan Behnel stefan...@behnel.de wrote: Hi Brett, thanks for the feedback. Brett Cannon, 08.11.2012 15:41: On Thu, Nov 8, 2012 at 7:47 AM, Stefan Behnel wrote: I propose to split the extension module initialisation into

Re: [Python-Dev] Update - Re: Make extension module initialisation more like Python module initialisation

2012-11-08 Thread Nick Coghlan
On Fri, Nov 9, 2012 at 12:32 AM, Stefan Behnel stefan...@behnel.de wrote: here's an updated proposal, adopting Marc-Andre's improvement that uses a new field in the PyModuleDef struct to register the callback. Note that this change no longer keeps up binary compatibility, which may or may not

[Python-Dev] Detecting tp_compare / tp_richcompare from Python

2012-11-08 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 While porting the BTrees package (split out from ZODB) to Python3., my first step is to get the pure-Python reference implementation working: in order to do that, I need a way to check that objects used as keys are *not* using the comparison semantics

Re: [Python-Dev] Detecting tp_compare / tp_richcompare from Python

2012-11-08 Thread Guido van Rossum
Well, the default behavior has changed to raise an exception when using , =, , =; i.e., inequalities do not have a default implementation at all. Perhaps that is enough for your purpose? == and != still compare by pointer, but you're primarily interested in ordering her, right? On Thu, Nov 8,

Re: [Python-Dev] cpython: Issue #16218: skip test if filesystem doesn't support required encoding

2012-11-08 Thread Serhiy Storchaka
On 08.11.12 01:08, R. David Murray wrote: Alexandre's point was that the string did not appear to be arbitrary, but rather appeared to specifically be a string containing surrogates. Is this not the case? My intention was testing with filename which cannot be decoded as UTF-8 in strict mode.

Re: [Python-Dev] Detecting tp_compare / tp_richcompare from Python

2012-11-08 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/08/2012 12:38 PM, Guido van Rossum wrote: Well, the default behavior has changed to raise an exception when using , =, , =; i.e., inequalities do not have a default implementation at all. Perhaps that is enough for your purpose? == and !=

Re: [Python-Dev] Detecting tp_compare / tp_richcompare from Python

2012-11-08 Thread Guido van Rossum
In Python, you can write if C.__eq__ == object.__eq__: print('class C does not override __eq__') Does that help? On Thu, Nov 8, 2012 at 9:55 AM, Tres Seaver tsea...@palladion.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/08/2012 12:38 PM, Guido van Rossum wrote: Well,

Re: [Python-Dev] chained assignment weirdity

2012-11-08 Thread Serhiy Storchaka
On 08.11.12 03:11, Ned Batchelder wrote: Sorry, I should have been clearer: I was asking about weird not to say, This is weird and should be changed!, but to get clarification from Serhiy about his statement, It will be weird if a dict comprehension and a plain loop will be inconsistent.

Re: [Python-Dev] cpython: Issue #16218: skip test if filesystem doesn't support required encoding

2012-11-08 Thread Alexandre Vassalotti
On Thu, Nov 8, 2012 at 9:45 AM, Serhiy Storchaka storch...@gmail.comwrote: My intention was testing with filename which cannot be decoded as UTF-8 in strict mode. I agree that testing with name which is encodable in locale encoding can be useful too, but now the test has no effect on UTF-8

Re: [Python-Dev] cpython: Issue #16218: skip test if filesystem doesn't support required encoding

2012-11-08 Thread Serhiy Storchaka
On 08.11.12 20:10, Alexandre Vassalotti wrote: So should we change the test back? Or just change the test name? No. I also missed some details. The issue is still not closed. ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Detecting tp_compare / tp_richcompare from Python

2012-11-08 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/08/2012 12:59 PM, Guido van Rossum wrote: In Python, you can write if C.__eq__ == object.__eq__: print('class C does not override __eq__') Does that help? That works in Python3, but not in Python2 -- methodwrappers don't compare equal

Re: [Python-Dev] Detecting tp_compare / tp_richcompare from Python

2012-11-08 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/08/2012 02:51 PM, Tres Seaver wrote: On 11/08/2012 12:59 PM, Guido van Rossum wrote: In Python, you can write if C.__eq__ == object.__eq__: print('class C does not override __eq__') Does that help? That works in Python3, but not in

Re: [Python-Dev] cpython: issue9584: Add {} list expansion to glob. Original patch by Mathieu Bridon

2012-11-08 Thread Georg Brandl
On 11/06/2012 02:56 PM, tim.golden wrote: http://hg.python.org/cpython/rev/dafca4714298 changeset: 80273:dafca4714298 user:Tim Golden m...@timgolden.me.uk date:Tue Nov 06 13:50:42 2012 + summary: issue9584: Add {} list expansion to glob. Original patch by Mathieu

Re: [Python-Dev] cpython: issue9584: Add {} list expansion to glob. Original patch by Mathieu Bridon

2012-11-08 Thread Georg Brandl
On 11/08/2012 09:43 PM, Georg Brandl wrote: Needs a versionchanged. In any case, brace expansion is not part of globbing (see the bash or zsh manuals) because it does not generate valid file names, and it is a non-POSIX expansion of some shells. Are you sure it should be put into the glob

Re: [Python-Dev] cpython: issue9584: Add {} list expansion to glob. Original patch by Mathieu Bridon

2012-11-08 Thread Tim Golden
On 08/11/2012 20:43, Georg Brandl wrote: On 11/06/2012 02:56 PM, tim.golden wrote: http://hg.python.org/cpython/rev/dafca4714298 changeset: 80273:dafca4714298 user:Tim Golden m...@timgolden.me.uk date:Tue Nov 06 13:50:42 2012 + summary: issue9584: Add {} list expansion