Re: [Python-Dev] PEP for allowing 'raise NewException from None'

2012-01-29 Thread Ethan Furman
Benjamin Peterson wrote: 2012/1/26 Ethan Furman et...@stoneleaf.us: PEP: XXX Congratulations, you are now PEP 409. Thanks, Benjamin! So, how do I make changes to it? ~Ethan~ ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] PEP for allowing 'raise NewException from None'

2012-01-29 Thread Ethan Furman
For those not on the nosy list, here's the latest post to http://bugs.python.org/issue6210: --- It looks like agreement is forming around the raise ... from None method. It has been mentioned more than once that having the context

Re: [Python-Dev] PEP for allowing 'raise NewException from None'

2012-01-29 Thread Georg Brandl
Am 29.01.2012 08:42, schrieb Ethan Furman: Benjamin Peterson wrote: 2012/1/26 Ethan Furman et...@stoneleaf.us: PEP: XXX Congratulations, you are now PEP 409. Thanks, Benjamin! So, how do I make changes to it? Please send PEP updates to the PEP editors at p...@python.org. Georg

[Python-Dev] A new dictionary implementation

2012-01-29 Thread Mark Shannon
Hi, Now that issue 13703 has been largely settled, I want to propose my new dictionary implementation again. It is a little more polished than before. https://bitbucket.org/markshannon/hotpy_new_dict Object-oriented benchmarks use considerably less memory and are sometimes faster (by a small

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread Antoine Pitrou
Hi, On Sun, 29 Jan 2012 10:31:48 + Mark Shannon m...@hotpy.org wrote: Now that issue 13703 has been largely settled, I want to propose my new dictionary implementation again. It is a little more polished than before. https://bitbucket.org/markshannon/hotpy_new_dict I briefly took a

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread Benjamin Peterson
2012/1/29 Mark Shannon m...@hotpy.org: Hi, Now that issue 13703 has been largely settled, I want to propose my new dictionary implementation again. It is a little more polished than before. If you're serious about changing the dictionary implementation, I think you should write a PEP. It

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread Antoine Pitrou
On Sun, 29 Jan 2012 09:56:11 -0500 Benjamin Peterson benja...@python.org wrote: 2012/1/29 Mark Shannon m...@hotpy.org: Hi, Now that issue 13703 has been largely settled, I want to propose my new dictionary implementation again. It is a little more polished than before. If you're

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread Benjamin Peterson
2012/1/29 Antoine Pitrou solip...@pitrou.net: On Sun, 29 Jan 2012 09:56:11 -0500 Benjamin Peterson benja...@python.org wrote: 2012/1/29 Mark Shannon m...@hotpy.org: Hi, Now that issue 13703 has been largely settled, I want to propose my new dictionary implementation again. It is a

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread Mark Shannon
Antoine Pitrou wrote: Hi, On Sun, 29 Jan 2012 10:31:48 + Mark Shannon m...@hotpy.org wrote: Now that issue 13703 has been largely settled, I want to propose my new dictionary implementation again. It is a little more polished than before. https://bitbucket.org/markshannon/hotpy_new_dict

[Python-Dev] #include Python.h

2012-01-29 Thread Andrea Crotti
I have a newbie question about CPython. Looking at the C code I noted that for example in tupleobject.c there is only one include #include Python.h Python.h actually includes everything as far as I can I see so: - it's very hard with a not-enough smart editor to find out where the not-locally

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread Mark Shannon
Antoine Pitrou wrote: On Sun, 29 Jan 2012 09:56:11 -0500 Benjamin Peterson benja...@python.org wrote: 2012/1/29 Mark Shannon m...@hotpy.org: Hi, Now that issue 13703 has been largely settled, I want to propose my new dictionary implementation again. It is a little more polished than before.

Re: [Python-Dev] #include Python.h

2012-01-29 Thread Oleg Broytman
Hello. We are sorry but we cannot help you. This mailing list is to work on developing Python (adding new features to Python itself and fixing bugs); if you're having problems learning, understanding or using Python, please find another forum. Probably python-list/comp.lang.python mailing

Re: [Python-Dev] #include Python.h

2012-01-29 Thread Andrea Crotti
On 01/29/2012 05:22 PM, Oleg Broytman wrote: Hello. We are sorry but we cannot help you. This mailing list is to work on developing Python (adding new features to Python itself and fixing bugs); if you're having problems learning, understanding or using Python, please find another forum.

Re: [Python-Dev] #include Python.h

2012-01-29 Thread C. Titus Brown
On Sun, Jan 29, 2012 at 05:59:51PM +, Andrea Crotti wrote: On 01/29/2012 05:22 PM, Oleg Broytman wrote: Hello. We are sorry but we cannot help you. This mailing list is to work on developing Python (adding new features to Python itself and fixing bugs); if you're having problems

Re: [Python-Dev] #include Python.h

2012-01-29 Thread Paul Moore
On 29 January 2012 18:10, C. Titus Brown c...@msu.edu wrote: python-dev isn't that inappropriate, IMO, but probably the best place to go with this discussion is python-ideas.  Could you repost over there? I agree that python-dev isn't particularly appropriate, python-list is probably your best

Re: [Python-Dev] #include Python.h

2012-01-29 Thread Andrea Crotti
On 01/29/2012 06:34 PM, Paul Moore wrote: On 29 January 2012 18:10, C. Titus Brownc...@msu.edu wrote: python-dev isn't that inappropriate, IMO, but probably the best place to go with this discussion is python-ideas. Could you repost over there? I agree that python-dev isn't particularly

Re: [Python-Dev] #include Python.h

2012-01-29 Thread Eli Bendersky
On Sun, Jan 29, 2012 at 17:34, Andrea Crotti andrea.crott...@gmail.com wrote: I have a newbie question about CPython. Looking at the C code I noted that for example in tupleobject.c there is only one include #include Python.h Python.h actually includes everything as far as I can I see so: -

Re: [Python-Dev] [issue13703] Hash collision security issue

2012-01-29 Thread Gregory P. Smith
On Fri, Jan 27, 2012 at 11:39 AM, mar...@v.loewis.de wrote: In fact, none of the strategies fixes all issues with hash collisions; even the hash-randomization solutions only deal with string keys, and don't consider collisions on non-string keys. The hash-randomization approach also works

Re: [Python-Dev] plugging the hash attack

2012-01-29 Thread Gregory P. Smith
On Fri, Jan 27, 2012 at 6:33 PM, Benjamin Peterson benja...@python.org wrote: 2012/1/27 Steven D'Aprano st...@pearwood.info: Benjamin Peterson wrote: Hello everyone, In effort to get a fix out before Perl 6 goes mainstream, Barry and I have decided to pronounce on what we want for our stable

Re: [Python-Dev] PEP 408 -- Standard library __preview__ package

2012-01-29 Thread Gregory P. Smith
On Fri, Jan 27, 2012 at 9:26 AM, Alex alex.gay...@gmail.com wrote: Eli Bendersky eliben at gmail.com writes: Hello, Following an earlier discussion on python-ideas [1], we would like to propose the following PEP for review. Discussion is welcome. The PEP can also be viewed in HTML form at

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread francis
On 01/29/2012 11:31 AM, Mark Shannon wrote: It passes all the tests. (I had to change a couple that relied on dict repr() ordering) Hi Mark, I've cloned the repo, build it the I've tried with ./python -m test. I got some errors: First in general: 340 tests OK. 2 tests failed: test_dis

Re: [Python-Dev] PEP 408 -- Standard library __preview__ package

2012-01-29 Thread Paul Moore
On 29 January 2012 21:39, Gregory P. Smith g...@krypto.org wrote: An example of this working: ipaddr is ready to go in. It got the eyeballs and API modifications while still a pypi library as a result of the discussion around the time it was originally suggested as being added.  I or any

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread Martin v. Löwis
Now that issue 13703 has been largely settled, I want to propose my new dictionary implementation again. It is a little more polished than before. Please clarify the status of that code: are you actually proposing 6a21f3b35e20 for inclusion into Python as-is? If so, please post it as a patch

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread Mark Shannon
francis wrote: On 01/29/2012 11:31 AM, Mark Shannon wrote: It passes all the tests. (I had to change a couple that relied on dict repr() ordering) Hi Mark, I've cloned the repo, build it the I've tried with ./python -m test. I got some errors: First in general: 340 tests OK. 2 tests

Re: [Python-Dev] PEP 408 -- Standard library __preview__ package

2012-01-29 Thread Barry Warsaw
On Jan 28, 2012, at 07:29 PM, Guido van Rossum wrote: Finally, if you really want to put warnings in whenever an experimental module is being used, make it a silent warning, like SilentDeprecationWarning. That allows people to request more strict warnings without unduly alarming the users of an

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread Mark Shannon
Martin v. Löwis wrote: Now that issue 13703 has been largely settled, I want to propose my new dictionary implementation again. It is a little more polished than before. Please clarify the status of that code: are you actually proposing 6a21f3b35e20 for inclusion into Python as-is? If so,

Re: [Python-Dev] Switching to Visual Studio 2010

2012-01-29 Thread Martin v. Löwis
I... I think I might have already done this, inadvertently. I needed an x64 VS2010 debug build of Subversion/APR*/Python a few weeks ago -- forgetting the fact that we're still on VS2008. There is a lot of duplication of work going on here: at least four people have done the same.

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread Martin v. Löwis
Please clarify the status of that code: are you actually proposing 6a21f3b35e20 for inclusion into Python as-is? If so, please post it as a patch to the tracker, as it will need to be reviewed (possibly with requests for further changes). I thought it already was a patch. What do I need to

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread Mark Shannon
Matt Joiner wrote: Mark, Good luck with getting this in, I'm also hopeful about coroutines, maybe after pushing your dict optimization your coroutine implementation will get more consideration. Shush, don't say the C word or you'll put people off ;) I'm actually not that fussed about the

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread Steven D'Aprano
Mark Shannon wrote: Antoine Pitrou wrote: On Sun, 29 Jan 2012 09:56:11 -0500 Benjamin Peterson benja...@python.org wrote: 2012/1/29 Mark Shannon m...@hotpy.org: Hi, Now that issue 13703 has been largely settled, I want to propose my new dictionary implementation again. It is a little more

Re: [Python-Dev] PEP 408 -- Standard library __preview__ package

2012-01-29 Thread Nick Coghlan
On Mon, Jan 30, 2012 at 8:44 AM, Barry Warsaw ba...@python.org wrote: Nothing beats people beating on it heavily for years in production code to shake things out.  I often think a generic answer to did I get the API right could be no, but it's okay :) Heh, my answer to complaints about the

Re: [Python-Dev] threading.Semaphore()'s counter can become negative for non-ints

2012-01-29 Thread Victor Stinner
import threading s = threading.Semaphore(0.5) But why would you want to pass a float? It seems like API abuse to me. If something should be changed, Semaphore(arg) should raise a TypeError if arg is not an integer. Victor ___ Python-Dev mailing

Re: [Python-Dev] PEP 408 -- Standard library __preview__ package

2012-01-29 Thread Matt Joiner
I think an advocacy of 3rd party modules would start with modules such as ipaddr, requests, regex. Linking directly to them from the python core documentation, while requesting they hold a successful moratorium in order to be included in a later standard module release. On Jan 30, 2012 10:47 AM,

Re: [Python-Dev] A new dictionary implementation

2012-01-29 Thread francis
I still have gdb 6.somthing, would you mail me the full output please, so I can see what the problem is. It's done, let me know if you need more output. Cheers, francis ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] threading.Semaphore()'s counter can become negative for non-ints

2012-01-29 Thread John O'Connor
On Sat, Jan 28, 2012 at 3:07 PM, Benjamin Peterson benja...@python.org wrote: But why would you want to pass a float? It seems like API abuse to me. Agreed. Anything else seems meaningless. ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] PEP for allowing 'raise NewException from None'

2012-01-29 Thread Ethan Furman
Latest addition for PEP 409 has been sent. Text follows: Language Details Currently, __context__ and __cause__ start out as None, and then get set as exceptions occur. To support 'from None', __context__ will stay as it is, but __cause__ will start out as False, and will

Re: [Python-Dev] PEP for allowing 'raise NewException from None'

2012-01-29 Thread Nick Coghlan
On Mon, Jan 30, 2012 at 2:51 PM, Ethan Furman et...@stoneleaf.us wrote: raise ... from ... is not disallowed outside a try block, but this behavior is not guaranteed to remain. -- Should that last disclaimer be there?  Should it