[issue12428] functools test coverage

2012-11-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset fcfaca024160 by Antoine Pitrou in branch 'default': Issue #12428: Add a pure Python implementation of functools.partial(). http://hg.python.org/cpython/rev/fcfaca024160 -- nosy: +python-dev ___ Python

[issue12428] functools test coverage

2012-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sorry for the delay. I have now committed the patch to 3.4 (default). Thank you! -- resolution: - fixed stage: commit review - committed/rejected status: open - closed versions: +Python 3.4 -Python 3.3 ___ Python

[issue12428] functools test coverage

2012-11-13 Thread Eric Snow
Eric Snow added the comment: The following from the changeset left me with questions: -from _functools import partial, reduce +try: +from _functools import reduce +except ImportError: +pass * Why the try block when there wasn't one before? * Should reduce be added to __all__ only

[issue12428] functools test coverage

2012-11-13 Thread Brian Thorne
Brian Thorne added the comment: * Why the try block when there wasn't one before? * Should reduce be added to __all__ only conditionally? My mistake, the try block should have just covered the import of partial - that is after all the exceptional circumstance we can deal with by using the

[issue12428] functools test coverage

2012-11-13 Thread Eric Snow
Eric Snow added the comment: Possibly reduce could be handled in a similar way with a fallback python implementation? Otherwise your suggestion of conditionally adding it to __all__ makes sense to me. In the meantime I'd expect the import of _functools.reduce to not be wrapped in a try

[issue12428] functools test coverage

2012-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Possibly reduce could be handled in a similar way with a fallback python implementation? Otherwise your suggestion of conditionally adding it to __all__ makes sense to me. In the meantime I'd expect the import of _functools.reduce to not be wrapped

[issue12428] functools test coverage

2012-08-05 Thread Brian Thorne
Brian Thorne added the comment: Back to a simpler closure implementation of partial and skip the repr test for python implementation. -- Added file: http://bugs.python.org/file26697/functools.patch ___ Python tracker rep...@bugs.python.org

[issue12428] functools test coverage

2012-07-24 Thread Brian Thorne
Brian Thorne hardb...@gmail.com added the comment: Thanks Antoine, the __class__ attribute wasn't useful, I've removed that. Overriding the __setattr__ and __delattr__ gives consistent behaviour with the both versions - allowing the unittest reuse. Also I've changed thread back to _thread.

[issue12428] functools test coverage

2012-07-24 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le mardi 24 juillet 2012 à 06:00 +, Brian Thorne a écrit : Isn't more compatibility between the Python and C implementations desired? IMHO, not when compatibility regards obscure details such as whether setting an attribute is allowed or

[issue12428] functools test coverage

2012-07-23 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Why does the pure Python version of partial have to be so complicated? I don't think the __class__, __setattr__ and __delattr__ are useful. As Raymond said, only the core, documented functionality needs to be preserved, not implementation

[issue12428] functools test coverage

2012-07-16 Thread Brian Thorne
Changes by Brian Thorne hardb...@gmail.com: -- nosy: +jackdied ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12428 ___ ___ Python-bugs-list

[issue12428] functools test coverage

2012-04-13 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12428 ___ ___

[issue12428] functools test coverage

2012-04-11 Thread Brian Thorne
Brian Thorne hardb...@gmail.com added the comment: I've updated the patch to address the comments here and in the code review. I added more cross testing of the pure Python implementation of partial - as you pointed out inheritance wasn't supported so I changed from the simple closure to a

[issue12428] functools test coverage

2012-02-20 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Just noticed one minor nit with the patch: the pure Python version of functools.partial should support func as a keyword argument that is passed to the underlying object. The trick is to declare a positional only argument like this: def

[issue12428] functools test coverage

2012-02-20 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Also, the closure based implementation should be decorated with @staticmethod (see http://bugs.python.org/issue11704) and the tests updated accordingly. -- ___ Python tracker rep...@bugs.python.org

[issue12428] functools test coverage

2011-12-09 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Brian's patch looks ok to me. There's a missing newline (or two) just before test_main() but that can easily be fixed on commit. -- nosy: +pitrou stage: - commit review versions: +Python 3.3 -Python 3.2

[issue12428] functools test coverage

2011-12-09 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Ezio and I made further minor comments that can be handled by the person doing the commit; I’d like to do it. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org

[issue12428] functools test coverage

2011-07-30 Thread Brian Thorne
Brian Thorne hardb...@gmail.com added the comment: Cheers for the comments Eric. I've modified the patch accordingly. -- Added file: http://bugs.python.org/file22801/functools2.diff ___ Python tracker rep...@bugs.python.org

[issue12428] functools test coverage

2011-06-28 Thread Brian Thorne
New submission from Brian Thorne hardb...@gmail.com: The test coverage for functools was down around ~60%, this is a patch to bring that up to ~98%. Made two changes to the Lib/functools.py file itself: 1) Moved the Python implementation of partial into Lib/functools.py from

[issue12428] functools test coverage

2011-06-28 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Raymond, do we care whether or not the pure Python version of functools.partial supports inheritance and instance testing? The constructor is technically documented as returning a partial object rather than a simple staticmethod instance with

[issue12428] functools test coverage

2011-06-28 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Raymond, do we care whether or not the pure Python version of functools.partial supports inheritance and instance testing? We don't care. The docs make very few guarantees beyond the core functionality. Everything else is an