[issue27137] Python implementation of `functools.partial` is not a class

2016-09-10 Thread Emanuel Barry
Emanuel Barry added the comment: Thank you Nick! I just opened #28062 to fix the repr inconsistency between functools.partial and any subclass :) -- ___ Python tracker

[issue27137] Python implementation of `functools.partial` is not a class

2016-09-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset cdc91b6ae3b2 by Nick Coghlan in branch 'default': Issue #27137: align Python & C implementations of functools.partial https://hg.python.org/cpython/rev/cdc91b6ae3b2 -- nosy: +python-dev ___ Python

[issue27137] Python implementation of `functools.partial` is not a class

2016-09-10 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks folks - for 3.6, the pure Python and accelerated C implementations of functools.partial are now both multiprocessing, subclassing, and REPL friendly :) -- resolution: -> fixed stage: commit review -> resolved status: open -> closed

[issue27137] Python implementation of `functools.partial` is not a class

2016-09-09 Thread Emanuel Barry
Emanuel Barry added the comment: The patch LGTM and applies fine. Looks like there's no need to wait for beta 2 after all; thanks Serhiy! -- ___ Python tracker

[issue27137] Python implementation of `functools.partial` is not a class

2016-09-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that makes C implementation repr matching Python implementation repr. It should be applied to all Python versions (the code is new). -- Added file: http://bugs.python.org/file44483/functools_partial_recursive_repr.patch

[issue27137] Python implementation of `functools.partial` is not a class

2016-09-08 Thread Brett Cannon
Brett Cannon added the comment: Ned will make the call about committing broken tests decorated with the expected failure decorator, but if you view this as a bug then this can go into b2 w/ passing tests instead. -- nosy: +ned.deily ___ Python

[issue27137] Python implementation of `functools.partial` is not a class

2016-09-08 Thread Emanuel Barry
Emanuel Barry added the comment: Can this be merged even with the two failing tests? I have little to no time available to fix it properly before the feature freeze. We can skip/silence those tests for a bit; I'll open a new issue and fix it in time for beta 2. --

[issue27137] Python implementation of `functools.partial` is not a class

2016-09-07 Thread Emanuel Barry
Emanuel Barry added the comment: Thank you Serhiy for the comments! Here's a new patch. I'm fine with the recursive repr tests failing for now; it's something I believe we can fix during the beta phase if we don't have time before (fix as in modify the C implementation to match the Python

[issue27137] Python implementation of `functools.partial` is not a class

2016-09-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think we can change C implementation of __repr__ to match straightforward Python implementation. -- ___ Python tracker

[issue27137] Python implementation of `functools.partial` is not a class

2016-09-07 Thread Emanuel Barry
Emanuel Barry added the comment: Hi Nick, thank you for letting me know! I started trying to fix this, however I found it very hard to fix the recursive repr issue. I've whipped up an incomplete (but yet working) patch that fixes all but the recursive repr issue. Only those two tests fail

[issue27137] Python implementation of `functools.partial` is not a class

2016-09-07 Thread Nick Coghlan
Nick Coghlan added the comment: Attempting to apply this, I found that the pure Python fallback fails the new recursive repr tests added in https://bugs.python.org/issue25455 The recursive pickling test is also failing, but I suspect that may be due to an error in my attempt to apply parts of

[issue27137] Python implementation of `functools.partial` is not a class

2016-09-05 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for the nudge, and sorry for getting distracted! I won't be able to get to this today, but I'll definitely handle it in time for the deadline :) -- ___ Python tracker

[issue27137] Python implementation of `functools.partial` is not a class

2016-09-05 Thread Emanuel Barry
Emanuel Barry added the comment: We're one week from the feature freeze, seems like a good time to merge this :) -- ___ Python tracker ___

[issue27137] Python implementation of `functools.partial` is not a class

2016-07-09 Thread Nick Coghlan
Nick Coghlan added the comment: Emanuel's latest patch looks good to me, but after seeing yet another behaviour discrepancy between the two versions(static method vs instance method behaviour), I've proposed disallowing function/class mismatches as an explicit policy clarification in PEP 399:

[issue27137] Python implementation of `functools.partial` is not a class

2016-07-06 Thread Nick Coghlan
Nick Coghlan added the comment: I should be able to take a look at the updated patch this coming weekend. -- stage: patch review -> commit review ___ Python tracker

[issue27137] Python implementation of `functools.partial` is not a class

2016-07-06 Thread Emanuel Barry
Emanuel Barry added the comment: Is there anything still preventing this from being merged? I think the ability to consistently get the same behaviour, with or without _functools available, outweighs the performance and simplicity loss (and as far as performance loss goes, it appears that

[issue27137] Python implementation of `functools.partial` is not a class

2016-06-04 Thread Emanuel Barry
Emanuel Barry added the comment: New patch, now almost all the tests that are used for the C version are also used for the Python version (the only exception is the one checking that trying to change/delete attributes would raise an error). Some tests needed a bit of tweaking to work with the

[issue27137] Python implementation of `functools.partial` is not a class

2016-06-02 Thread Nick Coghlan
Nick Coghlan added the comment: As Raymond notes, the main downside here is in terms of code complexity. However, the concrete gain is that APIs that rely on callable pickling, such as concurrent.futures with a ProcessPoolExecutor, would be consistently compatible with functools.partial: >>>

[issue27137] Python implementation of `functools.partial` is not a class

2016-05-30 Thread Emanuel Barry
Emanuel Barry added the comment: New patch after Serhiy's comments. I kept the __dict__ in pickling to properly pickle attributes that aren't defined by 'partial' itself; but if 'func', 'args' or 'keywords' are present and don't match the provided arguments, an error will be raised, as it

[issue27137] Python implementation of `functools.partial` is not a class

2016-05-30 Thread ppperry
Changes by ppperry : -- title: functools.partial: Inconsistency between Python and C implementations -> Python implementation of `functools.partial` is not a class ___ Python tracker