[issue16774] Additional recipes for itertools docs

2013-01-19 Thread Alexey Kachayev
Alexey Kachayev added the comment: It's hard to evaluate how popular given recipes, but: * drop is opposite to take, so it's as popular as take * the same situation with splitat, splitby - it's one case of partition that's hard to write each time with enumerator (partition is already

[issue16774] Additional recipes for itertools docs

2013-01-18 Thread Alexey Kachayev
Alexey Kachayev added the comment: Updated patch with: * fix error in islice function name * made n=None default second argument for consume(iterator, n=None) cause it provides specific behavior when n is None which can be assumed as default for function -- Added file: http

[issue14373] C implementation of functools.lru_cache

2012-12-30 Thread Alexey Kachayev
Alexey Kachayev added the comment: Thread-safe implementation for cache cleanup. -- Added file: http://bugs.python.org/file28490/14373.v7.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14373

[issue14373] C implementation of functools.lru_cache

2012-12-30 Thread Alexey Kachayev
Alexey Kachayev added the comment: Updated diff with: * fix object leaks * tp_clear * additional test for maxsize 0 I also reimplemented multithreading test (fixed error and added skip rule). But actually, I'm not sure that it's enough for ensuring thread-safety of clear operation. I'm

[issue16774] Additional recipes for itertools docs

2012-12-25 Thread Alexey Kachayev
Alexey Kachayev added the comment: Added: * takelast * droplast -- Added file: http://bugs.python.org/file28433/itertools.doc.v2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16774

[issue16774] Additional recipes for itertools docs

2012-12-24 Thread Alexey Kachayev
New submission from Alexey Kachayev: Additional recipes for itertools documentation (widespread functions in other programming languages): * drop * split-at * split-by -- assignee: docs@python components: Documentation files: itertools.doc.diff keywords: patch messages: 178098 nosy

[issue14373] C implementation of functools.lru_cache

2012-12-21 Thread Alexey Kachayev
Alexey Kachayev added the comment: Serhiy, thank you for review. Working further on fixes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14373

[issue14373] C implementation of functools.lru_cache

2012-12-21 Thread Alexey Kachayev
Alexey Kachayev added the comment: Fixed my previous patch according to all comments from review, except removing keyword arguments from lru_cache_new function. -- Added file: http://bugs.python.org/file28386/14373.v3.diff ___ Python tracker rep

[issue14373] C implementation of functools.lru_cache

2012-12-21 Thread Alexey Kachayev
Alexey Kachayev added the comment: Added additional Py_DECREF(s) for key and value. -- Added file: http://bugs.python.org/file28390/14373.v4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14373

[issue14373] C implementation of functools.lru_cache

2012-12-19 Thread Alexey Kachayev
Alexey Kachayev added the comment: Updated patch with next points: * fix typedefs * python implementation works normally without C acceleration * test cases cover both python/c implementations * several style fixes in C module -- nosy: +kachayev Added file: http://bugs.python.org

[issue16464] urllib.request: opener not resetting content-length

2012-11-22 Thread Alexey Kachayev
Alexey Kachayev added the comment: Fixed patch is attached. Documentation is updated. -- Added file: http://bugs.python.org/file28074/issue16464_fixed.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16464

[issue16464] urllib.request: opener not resetting content-length

2012-11-17 Thread Alexey Kachayev
Alexey Kachayev added the comment: This is special case for more general problem. When request is executed with HTTP client and data is not None, it calculates content length and adds special header to request. Then one can change request.data attribute value, but header Content-length

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-15 Thread Alexey Kachayev
Alexey Kachayev added the comment: Patch is attached for {float, Decimal} - {int, Fraction} consistency (with ValueError and OverflowError). Test cases are changed as well. I can also change OverflowError to ValueError for all cases, but I'm not sure should I open for this separated issue

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-15 Thread Alexey Kachayev
Alexey Kachayev added the comment: I also attached full_issue patch: change OverflowError to ValueError for all cases. -- Added file: http://bugs.python.org/file27991/full_issues16469.diff ___ Python tracker rep...@bugs.python.org http

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-15 Thread Alexey Kachayev
Changes by Alexey Kachayev kacha...@gmail.com: Added file: http://bugs.python.org/file27992/full_issues16469_fixed.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16469

[issue16483] Make int(float('inf')) raise ValueError rather than OverflowError.

2012-11-15 Thread Alexey Kachayev
Alexey Kachayev added the comment: Patch is attached (ported from full issue patch for issue 16469). -- keywords: +patch nosy: +kachayev Added file: http://bugs.python.org/file27993/issue16483.diff ___ Python tracker rep...@bugs.python.org http

[issue16469] Exceptions raised by Fraction() different from those raised by int()

2012-11-15 Thread Alexey Kachayev
Alexey Kachayev added the comment: Ok, I think that ValueError is more appropriate and I have already attached adopted patch for issue 16483. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16469

[issue16309] PYTHONPATH= different from no PYTHONPATH at all

2012-11-03 Thread Alexey Kachayev
Alexey Kachayev added the comment: Unit test added. pythonpath2.diff is included into issue16309.diff. -- nosy: +kachayev Added file: http://bugs.python.org/file27848/issue16309.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue7317] Display full tracebacks when an error occurs asynchronously

2012-11-03 Thread Alexey Kachayev
Alexey Kachayev added the comment: Updated test case for traceback printing, fixed test_cmd_line crashing with new ignored exception message formatting (test was based on regular expression). Patch is attached. -- nosy: +kachayev Added file: http://bugs.python.org/file27853/issue7317