[issue20223] inspect.signature does not support new functools.partialmethod

2014-01-24 Thread Nick Coghlan
Nick Coghlan added the comment: As far as pushing goes, I'd wait until Larry lands issue 20189 - I suspect there's a risk of conflict between these patches in the inspect module, and that one is key to getting builtin signatures supported properly :) -- dependencies: +inspect.Signature

[issue20223] inspect.signature does not support new functools.partialmethod

2014-01-24 Thread Nick Coghlan
Nick Coghlan added the comment: Yury, I believe the review comments from Rietveld go to the address you have registered as primary in the tracker, so that's currently your address with the ".ml" suffix rather than your main one. My only suggestion was to use ._partialmethod for the attribute n

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-24 Thread Larry Hastings
Larry Hastings added the comment: Okay, I'm checking this beast in. Hooray! Thanks for your reviews, everybody! -- I thought it was still possible to introduce objects into Python at runtime without calling PyType_Ready on their type. If that's true, then there wouldn't necessarily *be* a t

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-24 Thread Nick Coghlan
Nick Coghlan added the comment: Scanned the whole patch, especially the type changes. This looks like a solid approach to me. For 3.5, PEP 457 might want to consider proposing a tp_sig slot and splitting the signature out at type creation time rather than on attribute lookup. The current dyna

[issue20264] Update patchcheck to looks for files with clinic comments

2014-01-24 Thread Larry Hastings
Larry Hastings added the comment: Maybe I'm not reading this correctly. It looks like the function returns True if it finds any .c or .h file that contains the string '[clinic input]'. It doesn't seem to only check files that have changed. I was considering adding a checkum for the *input* t

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-24 Thread Larry Hastings
Larry Hastings added the comment: Okay, one more diff. I have high hopes for this, but then I had high hopes yesterday. Nick, could you review the PyTypeObject changes in this patch? Obviously I'd love a review of the whole thing, but if you can only make a little time, the crucial part is

[issue20317] ExitStack hang if enough nested exceptions

2014-01-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset b3eaeb4bdf84 by Nick Coghlan in branch '3.3': Issue 20317: Remove debugging code from contextlib http://hg.python.org/cpython/rev/b3eaeb4bdf84 New changeset a0bf53afedfa by Nick Coghlan in branch 'default': Merge removal of issue 20317 debugging cod

[issue20374] Failure to compile with readline-6.3-rc1

2014-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What if remove casts at all? Ned, is it compiled with libedit? -- keywords: +patch nosy: +serhiy.storchaka Added file: http://bugs.python.org/file33682/readline_func_cast.patch ___ Python tracker

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-24 Thread Nick Coghlan
Nick Coghlan added the comment: Oh, yes, now I remember - it *has* to be that way, otherwise upcalls from subclass __new__ methods don't do the right thing (int.__new__(MyInt), etc), just as you need to pass the current type in explicitly for cooperative super calls. This is perhaps *the* most

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: -serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-24 Thread Nick Coghlan
Nick Coghlan added the comment: (Also, I can't give you a solid reason for *why* it's like that - Guido just wrote it that way, and the type machinery is hairy enough that I have no intentions of second guessing him on that one) -- ___ Python tracke

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-24 Thread Nick Coghlan
Nick Coghlan added the comment: It doesn't act like a class method, though, it acts like a static method: >>> int.__new__() Traceback (most recent call last): File "", line 1, in TypeError: int.__new__(): not enough arguments >>> int.__new__(int) 0 You have to *write*

[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

2014-01-24 Thread Larry Hastings
Larry Hastings added the comment: Your patch does not address my concern. My concern is that itertools.repeat doesn't parse its arguments like other Python functions. It behaves differently depending on whether "times" is passed by position or by keyword. Therefore its actual calling signatu

[issue20377] Argument Clinic: get rid of the "_impl" suffix

2014-01-24 Thread Larry Hastings
Larry Hastings added the comment: I'm sorry, but I simply don't have the time to spend to dig it up right now. It was a while ago and I'm not sure exactly where to look. I dimly recall it was last year, probably during September-December, and that both Nick and I were in it. It was probably

[issue20377] Argument Clinic: get rid of the "_impl" suffix

2014-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please provide a link on this discussion? There were too many discussions and I had quickly lost them. Argument Clinic was changed too much for last weeks, so perhaps consensus is changed. -- ___ Python

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-24 Thread Larry Hastings
Larry Hastings added the comment: > Note that tp_new is a static method, not a class method (the type > creation machinery takes care of passing in the right class rather > than the descriptor machinery) I admit I didn't know that. But from a practical perspective, surely you agree that tp_new

[issue20189] inspect.Signature doesn't recognize all builtin types

2014-01-24 Thread Nick Coghlan
Nick Coghlan added the comment: Note that tp_new is a static method, not a class method (the type creation machinery takes care of passing in the right class rather than the descriptor machinery) -- ___ Python tracker

[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

2014-01-24 Thread Vajrasky Kok
Vajrasky Kok added the comment: def repeat(object, times=-1): => it could break the code in the wild. Current behaviour: repeat(object) -> unlimited, repeat(object, -1) -> 0 repetitions. -- ___ Python tracker __

[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

2014-01-24 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the updated patch. I try to be conservative here, preserving the current behaviour. Negative times is same as zero. Default value (which can be passed by omitting times) means unlimited. I did not change the signature "repeat(object [,times])" because th

[issue20311] epoll.poll(timeout) and PollSelector.select(timeout) must round the timeout to the upper bound

2014-01-24 Thread STINNER Victor
STINNER Victor added the comment: Guido van Rossum added the comment: > I've lost some context, but perhaps we should have the notion of > "granularity" of the poll/select timeout (e.g. 1 msec), and consider > events that are in the future by less than that granularity as ready? > Then we can rou

[issue20374] Failure to compile with readline-6.3-rc1

2014-01-24 Thread Ned Deily
Ned Deily added the comment: The checked-in fixes break builds on OS X that use the Apple-supplied libedit readline compatibility layer. See, for example: http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/1077/steps/compile/logs/stdio gcc -fno-strict-aliasing -Werror=d

[issue18670] Using read_mime_types function from mimetypes module gives resource warning

2014-01-24 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the updated patch based on Ezio's review. Sorry, for a long time, I didn't notice you had reviewed my code, Ezio. Thanks for the review! -- Added file: http://bugs.python.org/file33679/fix_resource_warning_read_mime_types_v3.patch __

[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-24 Thread Ram Rachum
Ram Rachum added the comment: I like the patch. Except I'd like to have support for the 'x' flag in the `write_text` and `write_bytes` methods. I suggest an argument `exclusive`, which defaults to `False`. When `exclusive=True`, the mode will be 'x' or 'xb'. The first lines after each method d

[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

2014-01-24 Thread Larry Hastings
Larry Hastings added the comment: I don't have a patch for this issue. If you're thinking of my "nullable ints" patch, that was just an experiment. I'd prefer we figure out what we're going to do on this issue, and we can talk abut conversion to Argument Clinic later. -- ___

[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

2014-01-24 Thread Vajrasky Kok
Vajrasky Kok added the comment: Serhiy said, "Why do you cast PyDict_Size(kwds) to int?" Sorry, Serhiy! Today I just realized there is your review for this ticket. I couldn't really remember but I think I got conversion warning if I did not downcast it. Something about I shouldn't not have ope

[issue20377] Argument Clinic: get rid of the "_impl" suffix

2014-01-24 Thread Larry Hastings
Larry Hastings added the comment: For the record, I was actually in favor of swapping them. You can try bringing it up again on python-dev if you like, but I'm not sure there's anything really new to say. -- ___ Python tracker

[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-01-24 Thread Vajrasky Kok
Vajrasky Kok added the comment: Updated marshal patch. I just learned we don't need to release pybuffer (y*) manually. -- Added file: http://bugs.python.org/file33678/clinic_marshal_v3.patch ___ Python tracker ___

[issue20377] Argument Clinic: get rid of the "_impl" suffix

2014-01-24 Thread Larry Hastings
Larry Hastings added the comment: We had this discussion already, some months ago. The consensus was to leave it the way it is. -- resolution: -> rejected status: open -> closed ___ Python tracker __

[issue20376] Argument Clinic: backslashes in docstrings are not escaped

2014-01-24 Thread Larry Hastings
Larry Hastings added the comment: Oops! They should be escaped. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue20173] Derby #4: Convert 53 sites to Argument Clinic across 5 files

2014-01-24 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the updated patch of codecsmodule, based on Larry's review. Thanks! I didn't realize clinic releases pybuffer implicitly. I also turned _codecs.Codecs to _codecs since all of these methods are module methods. -- Added file: http://bugs.python.org

[issue20377] Argument Clinic: get rid of the "_impl" suffix

2014-01-24 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: For now most hand-written functions which use Argument Clinic have the "_impl" suffix and generated wrapper functions without the "_impl" suffix are less interested and visible to developer (generated *_METHODDEF macros are used in method list). I propose

[issue20376] Argument Clinic: backslashes in docstrings are not escaped

2014-01-24 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Argument Clinic copies backslashes in docstrings as is. This can produce wrong or even invalid C string. Either backslashes should be escaped, or current behavior should be documented. -- components: Demos and Tools messages: 209044 nosy: larry, se

[issue20363] BytesWarnings triggerred by test suite

2014-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And 'print(hash(eval(%s.decode("utf-8"' % repr_.encode("utf-8") can be simplified to 'print(hash(eval(%a)))' % repr_ -- ___ Python tracker

<    1   2