Re: [Python-Dev] Guarantee the success of some object creation C API functions

2017-05-01 Thread Serhiy Storchaka
On 02.05.17 00:52, Chris Angelico wrote: Aside from straight-up bugs, how can one of these functions fail? Is memory allocation failure the only way? Yes, memory allocation failure is the only way. In normal Python build this can happen only at early stage of the interpreter initialization, u

Re: [Python-Dev] __getattribute__'s error is not available in __getattr__

2017-05-01 Thread Nick Coghlan
On 2 May 2017 at 13:47, Jason Maldonis wrote: > Hi everyone, > > If this should be asked in learn python I apologize -- please just tell me > without answering. > > I'm working on a large class architecture and I find myself often > overloading __getattr__. I am continuously running into the issu

Re: [Python-Dev] Guarantee the success of some object creation C API functions

2017-05-01 Thread Nick Coghlan
On 2 May 2017 at 07:52, Chris Angelico wrote: > On Tue, May 2, 2017 at 6:52 AM, Terry Reedy wrote: >> The promise makes it clear that breaking the property is a bug to be fixed. >> It only decreases the probability for someone who has read the promise. >> Unfortunately, 'never fail' is hard to te

[Python-Dev] __getattribute__'s error is not available in __getattr__

2017-05-01 Thread Jason Maldonis
Hi everyone, If this should be asked in learn python I apologize -- please just tell me without answering. I'm working on a large class architecture and I find myself often overloading __getattr__. I am continuously running into the issue where I want __getattr__ to have access to the error that

Re: [Python-Dev] Guarantee the success of some object creation C API functions

2017-05-01 Thread Chris Angelico
On Tue, May 2, 2017 at 6:52 AM, Terry Reedy wrote: > The promise makes it clear that breaking the property is a bug to be fixed. > It only decreases the probability for someone who has read the promise. > Unfortunately, 'never fail' is hard to test ;-). > Aside from straight-up bugs, how can one

Re: [Python-Dev] Guarantee the success of some object creation C API functions

2017-05-01 Thread Terry Reedy
On 5/1/2017 5:50 AM, Serhiy Storchaka wrote: I want to add promises to public C API functions that create trivial instances of immutable basic types (integers 0 and 1, empty tuple, string and bytes object) -- PyLong_FromLong(0), PyLong_FromLong(1), PyTuple_New(0), PyUnicode_FromStringAndSize(NULL

Re: [Python-Dev] Request review of cProfile/profile series issue

2017-05-01 Thread Louie Lu
For who may be reviewing cProfile / profile context manager problem, I prepare a post for explaining why the problem become, and why the patch will fix this problem: post: https://blog.louie.lu/2017/04/23/python-libs-profile-cant-context-manager/ Thanks, Louie. 2017-04-23 11:21 GMT+08:00 Louie

Re: [Python-Dev] Escaping docs markup in NEWS entries?

2017-05-01 Thread Wes Turner
Where would be a good place for test cases for an rst_escape() function? Docutils? https://github.com/westurner/dotfiles/blob/develop/scripts/git-changelog.py - rst_escape # YMMV - $ git-changelog.py -r "release/0.3.14" --hdr= "+"` On Monday, May 1, 2017, Nick Coghlan wrote: > On 1 May 2017 at

[Python-Dev] Guarantee the success of some object creation C API functions

2017-05-01 Thread Serhiy Storchaka
I want to add promises to public C API functions that create trivial instances of immutable basic types (integers 0 and 1, empty tuple, string and bytes object) -- PyLong_FromLong(0), PyLong_FromLong(1), PyTuple_New(0), PyUnicode_FromStringAndSize(NULL, 0), PyUnicode_FromString(""), PyBytes_FromStr

Re: [Python-Dev] Escaping docs markup in NEWS entries?

2017-05-01 Thread Nick Coghlan
On 1 May 2017 at 17:13, Martin Panter wrote: > On 1 May 2017 at 06:37, Nick Coghlan wrote: >> Hi folks, >> >> I'm trying to write a NEWS entry that explains that the >> ":func:`bytes`" cross-references have changed to refer to the type >> descriptions by default (matching other builtin container

Re: [Python-Dev] Escaping docs markup in NEWS entries?

2017-05-01 Thread Martin Panter
On 1 May 2017 at 06:37, Nick Coghlan wrote: > Hi folks, > > I'm trying to write a NEWS entry that explains that the > ":func:`bytes`" cross-references have changed to refer to the type > descriptions by default (matching other builtin container types), so > you now need to use ``:ref:`func-bytes`"