[issue9859] Add tests to verify API match of modules with 2 implementations

2015-04-14 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: With regret, I have not had time to work on patches and am unlikely to have time in the near future. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9859

[issue23565] local_clear walks the list of threads without holding head_lock.

2015-03-02 Thread Daniel Stutzbach
New submission from Daniel Stutzbach: local_clear in _threadmodule.c walks the list of threads without holding head_mutex. Since the list of threads can change when holding only head_mutex and not on the GIL, the list can change while local_clear is executing, which may cause Bad Things

[issue19081] zipimport behaves badly when the zip file changes while the process is running

2013-09-24 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19081 ___ ___ Python-bugs-list

[issue18606] Add statistics module to standard library

2013-08-04 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: As the person originally trying to take the mean of timedelta objects, I'm personally fine with the workaround of: py m = statistics.mean([x.total_seconds() for x in data]) py td(seconds=m) datetime.timedelta(2, 43200) At the time I was trying to take

[issue2226] Small _abcoll Bugs / Oddities

2013-01-16 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- assignee: stutzbach - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2226

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-17 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: On Tue, Apr 17, 2012 at 4:08 AM, Antoine Pitrou rep...@bugs.python.org wrote: has_finalizer() in gcmodule.c doesn't check for weakref callbacks, so a weakref callback can still be invoked from tp_dealloc. Unless I'm mistaken, weakrefs

[issue14534] Add method to mark unittest.TestCases as do not run.

2012-04-09 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Wouldn't the subclass inherit the False value? Then the user would need to remember to override the value again in the subclass, which is error prone. Antoine: I've used the pattern you describe on a couple of occasions

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-06 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: On Fri, Apr 6, 2012 at 12:51 PM, Jim Jewett rep...@bugs.python.org wrote: __del__ methods do run, even if an object was collected by the cycle detector. And they can't do any harm that couldn't also be done by a C finalizer

[issue9141] Allow objects to decide if they can be collected by GC

2012-04-06 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Are __del__ and tp_del getting conflated in this conversation? I don't see a __del__ method on generator objects: filfre:$ python3.1 Python 3.1.2 (r312:79147, Dec 9 2011, 20:47:34) [GCC 4.4.3] on linux2 (i for i in range(5)).__del__

[issue13804] Python library structure creates hard to read code when using higher order functions

2012-01-18 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Ah - in your first example (the one with 3 lines) did you mean to use .extend instead of .append? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13804

[issue13804] Python library structure creates hard to read code when using higher order functions

2012-01-17 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: If I'm understanding Martin Häcker's code correctly, the list comprehension equivalent is: self.questions = [topic.questions for topic in self.topics] The reduce() variants are not only much harder to read, but they will take O(n**2

[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-01-09 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13742 ___ ___ Python-bugs-list

[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2011-09-29 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Gladly. :-) -- resolution: - out of date stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8654

[issue12682] Meaning of 'accepted' resolution as documented in devguide

2011-08-02 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12682 ___ ___ Python-bugs-list

[issue11640] Shelve references globals in its __del__ method

2011-08-01 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Could you add a comment above the lines defining self._BytesIO, describing why they're being set? Someone else might see them as unnecessary and rip them out if there's no explanation. Can a test launch Python in a subprocess, set up

[issue12612] Valgrind suppressions

2011-08-01 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12612 ___ ___ Python-bugs-list

[issue12434] Strengthen 2.7 io types warning

2011-07-18 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: On Sat, Jul 16, 2011 at 2:04 AM, Eli Bendersky rep...@bugs.python.orgwrote: Therefore, I propose to change this error message to: unicode argument expected, got '%s' as Terry suggested. Sounds good to me. -- Added file

[issue12345] Add math.tau

2011-06-17 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: On Wed, Jun 15, 2011 at 8:10 PM, Nick Coghlan rep...@bugs.python.orgwrote: I'd like to add a new constant to the math module: tau = 2*math.pi Rather than repeating all the reasons for why tau makes more sense than pi

[issue12192] Doc that collection mutation methods return item or None

2011-05-27 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Comment: This rule applies to special methods like __getitem__ and __setitem__. 'lis.append(item)' is equivalent to lis.__setitem__(len(lis):len(lis), item), so it should not be so surprising that it has the same return. It's not true

[issue8777] Add threading.Barrier

2011-05-26 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- stage: - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8777

[issue12128] Allow `abc.abstractproperty` to be overridden by a data attribute

2011-05-20 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: SGTM. I've written code where this would have been useful. Could you write a patch? -- nosy: +stutzbach stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue12127] Inconsistent leading zero treatment

2011-05-20 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: -0 on making it valid ever, due to the different meaning in many other languages. -1 on making it valid while many still use a version of python where it's valid with a different meaning. Maybe for Python 4. ;-) -- nosy

[issue12128] Allow `abc.abstractproperty` to be overridden by a data attribute

2011-05-20 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: I misread the original request. I'm +1 on making the following work, if it doesn't work already: class MySubClass(MyAbstractClass): SOME_LIMIT = 5 # Implements abstract property with fixed value We should be able to check

[issue12128] Allow `abc.abstractproperty` to be overridden by a data attribute

2011-05-20 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Daniel, the behavior you describe is already present in Python 3.2. Awesome. :) Do you have a compelling use-case for making self.x = 5 satisfy an abstractproperty requirement? One of the problems with that approach

[issue11994] [2.7/gcc-4.4.3] Segfault under valgrind in string.split()

2011-05-04 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11994 ___ ___ Python-bugs-list

[issue11335] Memory leak after key function failure in sort

2011-05-04 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11335

[issue9971] Optimize BufferedReader.readinto

2011-05-04 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Looking at this again, I agree with John. For BufferedIOBase, read() is abstract while readinto() is concrete. That seems backward, and, indeed, it's the opposite of RawIOBase, where readinto() is abstract and read() is concrete

[issue11335] Memory leak after key function failure in sort

2011-05-02 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: I checked in a fix to 3.3 just before the transition to hg. I confess that I've been procrastinating on getting hg set up properly, which is why I haven't gotten to checking this in to 3.2. Georg, if I get this in by Wednesday

[issue11854] __or__ et al instantiate subclass of set without calling __init__

2011-04-16 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11854 ___ ___ Python-bugs-list

[issue6634] sys.exit() called from threads other than the main one: undocumented behaviour

2011-04-14 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6634 ___ ___ Python-bugs-list

[issue11845] Refcounting error in compute_slice_indices in rangeobject.c

2011-04-14 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11845 ___ ___ Python-bugs-list

[issue11707] Create C version of functools.cmp_to_key()

2011-04-01 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11707 ___ ___ Python-bugs-list

[issue7995] On Mac / BSD sockets returned by accept inherit the parent's FD flags

2011-03-30 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: I'm confused by the patch (ed0259230611). The patch comment and the NEWS item state the returned socket is now always non-blocking but the code change adds sock.setblocking(True). -- nosy: +stutzbach

[issue11674] list(obj), tuple(obj) swallow TypeError (in _PyObject_LengthHint)

2011-03-25 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11674 ___ ___ Python-bugs-list

[issue11635] concurrent.futures uses polling

2011-03-22 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11635 ___ ___ Python-bugs-list

[issue11640] Shelve references globals in its __del__ method

2011-03-22 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11640

[issue11628] cmp_to_key generated class should use __slots__

2011-03-21 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11628 ___ ___ Python-bugs-list

[issue11608] GzipFile cannot be used for streaming

2011-03-19 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11608 ___ ___ Python-bugs-list

[issue11583] os.path.isdir() is slow on windows

2011-03-17 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11583 ___ ___ Python-bugs-list

[issue11562] += on list inside a tuple raises TypeError but succeds anyway

2011-03-15 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach stage: - test needed versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11562

[issue11480] Cannot copy a class with a metaclass other than type

2011-03-14 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- keywords: +needs review nosy: +alexandre.vassalotti, stutzbach stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11480

[issue11455] issue a warning when populating a CPython type dict with non-string keys

2011-03-10 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: For what it's worth, I believe this could be implemented easily by calling _PyDict_HasOnlyStringKeys at the end of the class creation process. -- nosy: +stutzbach ___ Python tracker rep

[issue1553375] Add traceback.print_full_exception()

2011-03-04 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1553375

[issue9427] logging.error('...', exc_info=True) should display upper frames, too

2011-03-04 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- dependencies: +Add traceback.print_full_exception() nosy: +stutzbach versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9427

[issue11402] _PyUnicode_Init leaks a little memory once

2011-03-04 Thread Daniel Stutzbach
New submission from Daniel Stutzbach stutzb...@google.com: By the time _PyUnicode_Init is called and does the following: /* Init the implementation */ free_list = NULL; numfree

[issue11402] _PyUnicode_Init leaks a little memory once

2011-03-04 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- keywords: +needs review, patch Added file: http://bugs.python.org/file20999/unicode-leak.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11402

[issue11335] Memory leak after key function failure in sort

2011-03-02 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: I'm not sure. What infrastructure do we have to leaked memory that was allocated with PyMem_MALLOC? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11335

[issue11335] Memory leak after key function failure in sort

2011-03-02 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: I meant to *detect* leaked memory, of course. :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11335

[issue11335] Memory leak after key function failure in sort

2011-03-02 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: I played around with this a little. That code path doesn't appear to be exercised during the existing unit tests. I'll add a test so the leak at least shows up when the tests are run under valgrind

[issue4600] __class__ assignment: new-style? heap? == confusing

2011-02-27 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4600 ___ ___ Python-bugs-list

[issue11333] Add empty __slots__ to collections.abc abstract base classes

2011-02-26 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: +1. I've bumped into exactly this problem (https://github.com/DanielStutzbach/blist/issues/closed#issue/29) I'm not intimately familiar with how __slots__ works. Are there any drawbacks to adding an empty __slots__ to the ABCs

[issue10868] ABCMeta.register() should work as a decorator

2011-02-26 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Sounds good to me. Thanks for the clarifications and satisfying my curiosity! :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10868

[issue11335] Memory leak after key function failure in sort

2011-02-26 Thread Daniel Stutzbach
New submission from Daniel Stutzbach stutzb...@google.com: In list.sort, if a key function throws an exception, the memory to store the keys is never freed. I introduced the bug in r86937. I'll upload a patch for review shortly. -- assignee: stutzbach components: Interpreter Core

[issue11335] Memory leak after key function failure in sort

2011-02-26 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Below is a link to the code where leak occurs and the patch goes: http://svn.python.org/view/python/branches/py3k/Objects/listobject.c?view=markuppathrev=88554#l1944 -- keywords: +3.2regression, needs review, patch Added file

[issue10868] ABCMeta.register() should work as a decorator

2011-02-24 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: In what use-cases would you want to call MyABC.register() when defining a class instead of inheriting from MyABC? I always thought of the register() as hack to make it possible to support types written in C, which can't inherit from

[issue7111] abort when stderr is closed

2011-02-03 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: That's an interesting point. Do you know of places where we use fd 2 instead of sys.stderr? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7111

[issue7111] abort when stderr is closed

2011-02-03 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: On Thu, Feb 3, 2011 at 11:56 AM, Alexander Belopolsky rep...@bugs.python.org wrote: 3rd party extensions.    What is the use case for python -?    Is it important enough to justify the risk of accidental data loss? I don't think closing

[issue7111] abort when stderr is closed

2011-02-03 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: On Thu, Feb 3, 2011 at 12:18 PM, Antoine Pitrou rep...@bugs.python.org wrote: I just took a look at http://pypi.python.org/pypi/python-daemon/, and it uses dup2() to redirect standard streams, which is far nicer. I'm more worried about

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-17 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Committed in r87339. Thanks everyone for the feedback! -- assignee: eric.araujo - stutzbach keywords: -needs review resolution: - accepted stage: patch review - committed/rejected status: open - closed versions: -Python 2.7

[issue2226] Small _abcoll Bugs / Oddities

2010-12-17 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Raymond, Do you have around 10 minutes today to look at the patch I submitted in Issue 8743? It appears to solve both this issue and that one, which have priorities critical and high, respectively. It's a reasonably small patch

[issue2690] Precompute range length and enhance range subscript support

2010-12-17 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Doc change committed to py3k in r87346. Thanks, SilentGhost! I also committed r87349 to reverse r87162 (which was in the wrong branch). -- ___ Python tracker rep...@bugs.python.org http

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-17 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: On Fri, Dec 17, 2010 at 2:17 PM, Amaury Forgeot d'Arc wrote wrote: Err... in r87339 there is a typo in all occurrences of 'Py_ReprEntr': Py_ReprEnter of course! Well, that's embarrassing. Fixed in r87354

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-17 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8753 ___ ___ Python-bugs

[issue8040] It would be nice if documentation pages linked to other versions of the same document

2010-12-16 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: On Tue, Dec 14, 2010 at 7:22 PM, Ezio Melotti rep...@bugs.python.org wrote: If you want to work on this you should also consider that the URLs used on docs.python.org don't necessary match the directory structure present when building

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-15 Thread Daniel Stutzbach
New submission from Daniel Stutzbach stutzb...@google.com: Attached is a patch to add documentation for Py_ReprEnter and Py_ReprLeave. Assigning to d...@python for review. -- assignee: stutzbach - d...@python keywords: +needs review, patch nosy: +d...@python stage: needs patch - patch

[issue10711] Rip out HTTP 0.9 support

2010-12-15 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Would it be worth keeping (but modifying) test_http_0_9 to verify that the server complains in the expected way? -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http

[issue10711] Rip out HTTP 0.9 support

2010-12-15 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: At minimum, I think we should apply this part of Antoine's patch: -# Most web servers default to HTTP 0.9, i.e. don't send a status line. -default_request_version = HTTP/0.9 +default_request_version = HTTP/1.0

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-15 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Good point. My perspective is skewed by all of the time that I spend working on container types. :-) How about if I change the first sentence to the following? Properly implementing :attr:`tp_repr` for container types requires

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-15 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: Added file: http://bugs.python.org/file20071/repr-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8753

[issue8753] Py_ReprEnter and Py_ReprLeave are undocumented

2010-12-15 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Thanks. New patch attached with a cross-reference to reprlib.recursive_repr. -- Added file: http://bugs.python.org/file20072/repr-3.patch ___ Python tracker rep...@bugs.python.org http

[issue8040] It would be nice if documentation pages linked to other versions of the same document

2010-12-14 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- versions: -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8040 ___ ___ Python-bugs

[issue2226] Small _abcoll Bugs / Oddities

2010-12-14 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Minor point of clarity: you mean __rand__ not __radd__, right? Set objects do not support addition at all. Adding the __rand__ methods to collections.Set in and of itself is straightforward: def __rsub__(self, other

[issue8743] set() operators don't work with collections.Set instances

2010-12-14 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Would it be sufficient to: 1) Restrict collections.Set()'s operators to accept collection.Set but not arbitrary iterables, and 2) Fix Issue2226 and let set() | MySimpleSet() work via collections.Set.__ror__ Attached is a patch

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-10 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: In bltinmodule.c, it looks like some of the indentation doesn't line up? Bikeshedding aside, it looks good to me. I agree with Eric Smith that the first part macro name usually refers to the type of the first argument (or the type

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-07 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: +1 on the general idea of abstracting out repeated code. I will take a closer look at the details within the next few days. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue2690] Precompute range length and enhance range subscript support

2010-12-03 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: (I also noticed that the new methods from issue #9213 are not mentioned in the range() docs Wasn't that fixed in Issue9746? -- ___ Python tracker rep...@bugs.python.org http

[issue2690] Precompute range length and enhance range subscript support

2010-12-03 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: The descriptions of range's limitations there is no longer accurate (slicing is supported following this patch and containment testing is now efficient) Want to open a new issue for that? (or is there one already

[issue2690] Precompute range length and enhance range subscript support

2010-12-03 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: The descriptions of range's limitations in the docs still needs an update. -- assignee: georg.brandl - ncoghlan status: closed - open ___ Python tracker rep...@bugs.python.org http

[issue9915] speeding up sorting with a key

2010-12-02 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Committed as r86937. Thanks again for reviewing! Although I do not anticipate any problems, I will keep an eye on the buildbots just in case. Antoine, regarding ms-alloced = (list_size + 1) / 2;, I ended up adding an extensive comment

[issue9915] speeding up sorting with a key

2010-12-02 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: -- components: +Interpreter Core -Library (Lib) resolution: - accepted stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue9915] speeding up sorting with a key

2010-12-01 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: The use of Py_LOCAL_INLINE is new to me since we usually use #define instead, but this has a cleaner look to it. I am unclear on whether all the our target compilers support an inline keyword. If you're sure it works everywhere

[issue9915] speeding up sorting with a key

2010-12-01 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Just wanted to post this so there weren't any illusions about the patch being a big win. When a key function is defined, this is all you can possibly shave off the time for a comparison. I don't want to argue whether the patch

[issue10576] Add a progress callback to gcmodule

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: How about a string and a dict? the string can be start and stop and we can add interesting information to the dict as you suggest. I like where this is headed. How about putting the string in the dict, too? d['phase'] = 'start

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Daniel Stutzbach
New submission from Daniel Stutzbach stutzb...@google.com: The I/O ABC documentation has a blanket disclaimer at the top: The abstract base classes also provide default implementations of some methods in order to help implementation of concrete stream classes. For example, BufferedIOBase

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: +io and doc people Attached is a simple patch to add a table to the documentation summarizing the I/O ABCs. -- keywords: +patch nosy: +benjamin.peterson, ezio.melotti, georg.brandl Added file: http://bugs.python.org/file19885/io

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: What does unsupported mean? Abstract would look more exact. It means they raise io.UnsupportedOperation when called (unless the subclass overrides them to do something else). They are not marked with @abstractmethod, so Abstract

[issue10589] I/O ABC docs should specify which methods have implementations

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Other suggestions for a better name for that column are certainly welcome. :-) Stub Methods? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10589

[issue8743] set() operators don't work with collections.Set instances

2010-11-30 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Yes, I can take a stab at it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8743

[issue10576] Add a progress callback to gcmodule

2010-11-29 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: These functions will be very useful for any long-running program. Thank you for the patch. Would you be willing to write tests and documentation? Would it make more sense for the callback to take a boolean instead of an integer

[issue9915] speeding up sorting with a key

2010-11-23 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Antoine Pitrou wrote: Next time, please upload a single patch. Really. I haven't used Rietveld that much yet, and I'm still learning best-practices. I apologize for the painful experience. For anyone else planning to take a look

[issue9915] speeding up sorting with a key

2010-11-23 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Antoine, My original patch was much more focused, but had a slightly larger performance penalty for sorting random keys (see http://bugs.python.org/msg122178). Do you think the performance tradeoff there was still worthwhile? Ihave

[issue10437] ThreadPoolExecutor should accept max_workers=None

2010-11-22 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Amaury Forgeot d'Arc said: pypy does have a GIL! D'oh. That shows you how much I know about PyPy. Make that keep in mind that IronPython doesn't have a GIL. ;) Brian Quinlan said: I think that using the number of CPUs

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: I'm starting to get settled in here at Google and finding time to follow up on everything that got put on hold while moving. Based on the feedback everyone gave me (thanks!), I greatly revised my script for comparing the speed of sort

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: Added file: http://bugs.python.org/file19780/sort-faster.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9915

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Changes by Daniel Stutzbach stutzb...@google.com: Added file: http://bugs.python.org/file19781/detailed-speed-results.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9915

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Antoine Pitrou rep...@bugs.python.org wrote: Why don't you contribute a list sorting benchmark to the suite in http://hg.python.org/benchmarks/? I considered that, but I want to separately benchmark sorting different kinds

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Antoine Pitrou rep...@bugs.python.org wrote: Right, that wouldn't suit your present purposes. But apparently you are proposing to add a list sorting benchmark to the Tools directory, with lots of duplicated code from that repo... Oh

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: Raymond Hettinger rhettin...@users.sourceforge.net added the comment: That result is surprising though -- I thought the concept was manipulate the key and value arrays at the same time instead of just the keys If the key parameter

[issue9915] speeding up sorting with a key

2010-11-22 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: How did it get *faster* than the original (in the case with no key-function)? I was able to shave off some instructions in countrun(), binarysort(), and the setup and cleanup code in listsort() proper. For small n, these made

[issue10437] ThreadPoolExecutor should accept max_workers=None

2010-11-20 Thread Daniel Stutzbach
Daniel Stutzbach stutzb...@google.com added the comment: In my case, each thread launches a CPU-intensive process via subprocess, then waits for it to report output and exit. Also, keep in mind that PyPy and IronPython don't have a GIL (although I'm not a PyPy or IronPython user myself

  1   2   3   4   5   >