[issue28672] Explain in the "Data Model" document why arguments to __init__ are ok when __new__ is not defined

2016-11-11 Thread João Sebastião de Oliveira Bueno
New submission from João Sebastião de Oliveira Bueno: There is an specific Python behavior on object instantiation that is "expected" but not explicit, even for avanced users: When a custom class defines `__init__` with extra parameters, but do not overrides `__new__`, it simply works. But if

Re: Python String Handling

2016-11-11 Thread Steve D'Aprano
On Sat, 12 Nov 2016 09:29 am, subhabangal...@gmail.com wrote: > I have a string > "Hello my name is Richard" > > I have a list of words as, > ['Hello/Hi','my','name','is','Richard/P'] > > I want to identify the match of 'Hello' and 'Richard' > in list, and replace them with 'Hello/Hi" and

[issue28569] mock.attach_mock should work with any return value of patch()

2016-11-11 Thread Andrey Fedorov
Andrey Fedorov added the comment: To clarify, this is how I would expect these two functions to work together "out of the box" patches = { 'requests_get': 'requests.get', ... } root_mock = mock.Mock() for name, path in patches.items(): m = mock.patch(path, auto_spec=True)

[issue28614] Slice limit documentation could be misinterpreted in Python 2.

2016-11-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I am inclined to think that this should be closed. I concur. The problem with the nitpick and word-smithing is that over-explaining tends to make the docs harder to read and understand by getting in the way of the basic message. Given that this

[issue28587] list.index documentation missing start and stop arguments

2016-11-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: This patch looks very good and I especially like the example. One nit. It may be insufficient to say that the start/end arguments are interpreted the same as the slice notation. While that clear indicates the range being searched, it is silent on whether

[issue21145] Add the @cached_property decorator

2016-11-11 Thread Daniel Greenfeld
Daniel Greenfeld added the comment: I'm delighted to see a patch submitted, but I'm concerned that it isn't thread safe. This was implemented in the cached-property package I maintain: * https://github.com/pydanny/cached-property/issues/6 * https://github.com/pydanny/cached-property/pull/9 *

Fwd: Python does not start

2016-11-11 Thread Jelena Tavcar
Dear Sirs, when I click on the icon "IDLE (Python 3.5 32-bit)" nothing happens. It used to work and at some point it just didn't react. I have reinstalled the program several times and no improvement. I have also tried to run it as administrator, and installed other version too, but neither of

Re: Python does not start

2016-11-11 Thread eryk sun
On Fri, Nov 11, 2016 at 8:36 PM, Jelena Tavcar wrote: > > when I click on the icon "IDLE (Python 3.5 32-bit)" nothing happens. It > used to work and at some point it just didn't react. Try running IDLE from a command prompt by entering the following command: py

[issue21973] IDLE: catch user cfg file error, better error message, continue

2016-11-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: I closed #28658 in favor of this. For that issue, the exception was a UnicodeDecodeError instead of a configparser.Error. Both should be caught. Ingrid, sorry I never got back to this. A few months ago, Serhiy wrote a warning function for the

[issue21145] Add the @cached_property decorator

2016-11-11 Thread Carl Meyer
Carl Meyer added the comment: Thanks, Danny. Uploaded a version of the patch that adds thread-safety (with a test). Unlike in your lib, I didn't make it a separate version of the decorator; since the lock is not checked on cached access, its slight overhead on the initial computation is

[issue21145] Add the @cached_property decorator

2016-11-11 Thread Carl Meyer
Carl Meyer added the comment: Speaking of this hypothetical C version, what's the current policy on shipping stdlib C code that can't be emulated in pure Python? (I'm thinking of e.g. PyPy). -- ___ Python tracker

Python String Handling

2016-11-11 Thread subhabangalore
I have a string "Hello my name is Richard" I have a list of words as, ['Hello/Hi','my','name','is','Richard/P'] I want to identify the match of 'Hello' and 'Richard' in list, and replace them with 'Hello/Hi" and 'Richard/P' respectively. The result should look like, "Hello/Hi my name is

[issue28665] Harmonize STORE_DEREF with STORE_FAST and LOAD_DEREF

2016-11-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please measure the performance effect of these changes? -- ___ Python tracker ___

[issue28637] Python startup performance regression

2016-11-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks to Wolfgang. This is his idea, I just faster wrote the patch. -- ___ Python tracker ___

[issue28665] Harmonize STORE_DEREF with STORE_FAST and LOAD_DEREF

2016-11-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: No thanks. These aren't really important opcodes. While there may be a modest speed improvement for the same reasons as the previous patch (avoiding unnecessary work), the main reason to do these two patches is because you had suggested it and because it

<    1   2